Path: utzoo!utgpu!jarvis.csri.toronto.edu!helios.physics.utoronto.ca!ists!yunexus!maccs!cs4g6ag From: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Newsgroups: comp.sys.ibm.pc Subject: Re: Environment problems Message-ID: <25F5EB94.8142@maccs.dcss.mcmaster.ca> Date: 8 Mar 90 05:20:19 GMT References: <1990Mar7.073215.23815@agate.berkeley.edu> <16558@orstcs.CS.ORST.EDU> Reply-To: cs4g6ag@maccs.dcss.mcmaster.ca (Stephen M. Dunn) Organization: McMaster University, Hamilton, Ontario Lines: 45 In article <16558@orstcs.CS.ORST.EDU> larsen@mist.CS.ORST.EDU (Scott Larsen) writes: $I recently changed my autoexec file to set a few more environment var's, $and now I get the message: $Out of environment space $Does this mean I cannot set anymore environment variables? Is there a way $to get around this? Well, it means what it says - there's a given amount of space available for environment variables, and you're trying to use more than that amount. There is an easy way to change this, depending on what version of DOS you're using. For DOS 2.x (and also possibly 3.0 - I'm not sure), you can't change the amount of space for environment variables without patching COMMAND.COM. For more recent versions, you need a line line the following: shell=c:\command.com/p/e:xxx in your config.sys file (obviously, if your command.com isn't found as c:\command.com, you would insert the appropriate path). The /p switch is very important - it means "permanent", so that you can't exit out of that level and so that it executes autoexec.bat. Now for that /e:xxx switch. This specifies the amount of environment space. For recent versions of DOS (3.3 and later, possibly also 3.2 - I'm not sure), the xxx is the number of bytes to be allocated for the environment (it will be rounded up to the nearest paragraph; a paragraph is a 16-byte chunk). For earlier versions, the xxx is the number of paragraphs to allocate. Check your DOS manual for details on exactly how to do this for your version of DOS. How much space do you need? Well, for each string of the form varname=value you need one byte for each character in that entire line (so the above would take 7 + 1 + 5 = 13), plus one for a sentinel (a zero byte) which DOS adds to the end of it, so we need 14 bytes for that. In addition, there is a second sentinel byte after the very last string in the table. When calculating, don't forget to leave room for additions and changes to your environment table which may be made after you boot the machine! -- Stephen M. Dunn cs4g6ag@maccs.dcss.mcmaster.ca = "\nI'm only an undergraduate!!!\n"; **************************************************************************** "Oooh yes I need some love" - Rush