Path: utzoo!utgpu!water!watmath!clyde!rutgers!sunybcs!bingvaxu!leah!emb978 From: emb978@leah.Albany.Edu ( Eric M. Boehm) Newsgroups: comp.sys.ibm.pc Subject: Re: Environment space size? Summary: Setting environment size in DOS 3.x Keywords: environment variables size Message-ID: <554@leah.Albany.Edu> Date: 6 Jan 88 23:45:47 GMT References: <1900@ukecc.engr.uky.edu> Distribution: na Organization: The University at Albany, Computer Services Center Lines: 36 In article <1900@ukecc.engr.uky.edu>, agollum@engr.uky.edu (David Herron aka Admiral Gollum) 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 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