Path: utzoo!mnetor!uunet!husc6!cmcl2!brl-adm!umd5!ames!scubed!sweet From: sweet@scubed.UUCP (Kevin Sweet) Newsgroups: comp.sys.ibm.pc Subject: Re: Environment space size? Message-ID: <347@scubed.UUCP> Date: 7 Jan 88 17:18:12 GMT References: <1900@ukecc.engr.uky.edu> <554@leah.Albany.Edu> Reply-To: sweet@scubed.UUCP (Kevin Sweet) Distribution: na Organization: S-Cubed, San Diego California Lines: 57 Keywords: environment variables size Summary: DOS 3.10 specific In article <554@leah.Albany.Edu> emb978@leah.Albany.Edu (Eric M. Boehm) writes: ->In article <1900@ukecc.engr.uky.edu>, agollum@engr.uky.edu (David Herron) writes: ->-> Maybe I'm being dense, but how does one determine the size of the ->-> environmment space (ie, how much room there is for environment ->-> variables) from within a program? I can read the environment just ->-> fine, I just don't know how much free space there is. ->-> -> ->Assuming you are running MS-DOS 3.2, the default environment space is (I ->believe) 256 bytes. -> ->You can change this by inserting the following line into your config.sys ->file: -> ->shell=c:\dos\command.com c:\dos /e:nnnn /p -> ->where C:\dos\command.com tells DOS where to load command.com from the ->*FIRST* time it is loaded, c:\dos tells dos the pathname to load subsequent ->copies of command.com (in case that area of memory is overwritten by your ->application program), /e:nnnn tells DOS how many bytes to reserve for ->environment space (in 3.1 this number is in paragraphs [16 bytes] so just ->divide by 16), and /p tells DOS that this is the primary processor for the ^ but it is limited to 62 paragraphs in DOS 3.10 (still alot). Any number greater than 62 is ignored and you get the default of 10 paragraphs. ->exit command (usually to get out of child processes). -> ->I don't believe this works below 3.x (I have had conflicting reports) but it ->does work in 3.1 and 3.2 (at least for me). -> ->You can change the path to your copy of command.com as suits your needs. One ->last note, you will still need a copy of command.com in the root in order to ->format disks properly (no, I don't know why). -> ->Also note that no environment variable can occupy more than 127 (128?) bytes ->each! -> ->Eric M. Boehm ->EMB978@ALBNY1VX.BITNET ->EMB978@LEAH.ALBANY.EDU I know this isn't really an answer to the original poster's question but I found the information very useful. I have a copy of some patches to DOS 3.10 that I received from a recent poster (harvard!lhasa!Jerry.Lotto) that cover many different areas (like a patch to command.com that makes 'echo off' the default for batch files) and will send them to anyone who sends me an e-mail request. Stupid, Stupid, DOS. ( no smiley on that last statement |^) Kevin -- ---- kevin sweet -------------------------------- email: sweet@scubed.ARPA ---- work: 3398 carmel mountain, san diego, ca 92121-1095, 619-587-8499 home: 12205 carmel vista 242, san diego, ca 92130-2237, 619-259-9338 ------------- "any misspellings are, of course, made on purpose" --------------