[comp.sys.ibm.pc] Increasing environment space

perl@step.UUCP (Robert Perlberg) (08/19/88)

I just tried adding another directory to my PATH in the autoexec.bat
file, and when I boot, I get "out of environment space".  How can I
increase the initial allocation of environment space so that the set's
in my autoexec.bat will succeed?

Robert Perlberg
Dean Witter Reynolds Inc., New York
phri!{dasys1 | philabs | manhat}!step!perl
	-- "I am not a language ... I am a free man!"

pjh@mccc.UUCP (Pete Holsberg) (08/25/88)

In article <1320@number1.step.UUCP> perl@step.UUCP (Robert Perlberg) writes:
...I just tried adding another directory to my PATH in the autoexec.bat
...file, and when I boot, I get "out of environment space".  How can I
...increase the initial allocation of environment space so that the set's
...in my autoexec.bat will succeed?
...
...Robert Perlberg
...Dean Witter Reynolds Inc., New York
...phri!{dasys1 | philabs | manhat}!step!perl
...	-- "I am not a language ... I am a free man!"


In CONFIG.SYS,
	shell=c:\command.com /P /E:1024
will increase the environment area of DOS 3.2 and up to 1024 bytes. 
Under 3.1, divide the desired byte number by 16 and use the quotient.	

rob@conexch.UUCP (Robert Collins) (08/26/88)

In article <1320@number1.step.UUCP> perl@step.UUCP (Robert Perlberg) writes:
-I just tried adding another directory to my PATH in the autoexec.bat
-file, and when I boot, I get "out of environment space".  How can I
-increase the initial allocation of environment space so that the set's
-in my autoexec.bat will succeed?
-

By reading the DOS manual.
Check out CONFIG.SYS  "SHELL" command.
Put this in your config.sys:
SHELL=COMMAND.COM /E:xxxx
  "where xxxx specifies a base 10 integer and indicates the number of bytes
  to set the environment size.  This number must be in the range of
  160 to 32768.  It is rounded up to the nearest paragraph boundary.  If
  the size contains any non-numeric characters or is less than 160, the
  environment is set to 160 bytes.  If the size is greater than 32768 the
  environment is set to 32768."


-- 
"Worship the Lord your God, and serve him only."  Mat. 4:10
Robert Collins                 UUCP:  ucbvax!ucivax!icnvax!conexch!rob
HOMENET:  (714) 995-7344       UUCP:  uunet!ccicpg!turnkey!conexch!rob
WORKNET:  (714) 229-0284

roth@mrsvr.UUCP (The Unknown Programmer) (08/26/88)

> In article <1320@number1.step.UUCP> perl@step.UUCP (Robert Perlberg) writes:
> -I just tried adding another directory to my PATH in the autoexec.bat
> -file, and when I boot, I get "out of environment space".  How can I
> -increase the initial allocation of environment space so that the set's
> -in my autoexec.bat will succeed?


Once again.  The method used to increase the environment size
depends on the DOS version *AND* the OEM that mucked up the
MS-DOS version it used.

DOS versions 3.2+ can use the COMMAND.COM argument /E:xxxx to
change the environment size.  (See other messages for details,
or some DOS book or official DOS manual.)


*SOME* DOS version 3.1 can also change the environment size,
though the size to be sepcified is in different units than
for post 3.1.  Not all 3.1 versions can change the environment size
via "/E:"!  The OEM version 3.1 version that came with my system
cannot.

The environment size for DOS versions that do not accept the /E:
argument to COMMAND.COM can still be changed by modifying a couple
of bytes in COMMAND.COM that set the environment size.  I do not
have that information, but it should be noted that some DOS computers
are stuck at pre 3.1 versions because the manufacturer created 
a less-than 100% compatible system.


ALSO - not all DOS manuals for 3.1 document the /E: COMMAND.COM
argument. (And, as I've said, not all support it.  The version
of DOS that came with my clone does not support /E: and it is
supposed to be DOS 3.1.)


Note that creating a *large* environment (without saying what
"large" means) can create problems.  C programs typically
copy the environment onto its stack, and do so for each child
task.  A "large" environment can blow the stack.

Some problems have also been reported when using a
second copy of COMMAND.COM
on top of a copy that has a "larger" environment - the second
copy may not recognize the first copy has a "larger" environment.
(For example, escaping to the shell from a communications program.)



Dean A. Roth

roth@mrsvr.UUCP
{rutgers, uwvax} uwmcsd1!mrsvr!roth

deanr@lakesys.UUCP
{rutgers, uwvax} uwmcsd1!lakesys!deanr

P.O. Box 11095
Milwaukee, WI 53211