 
Reply-To: 
Distribution: worldRe: Out of environment space running BAT files from Windows
Organization: Aspen Technology Group
X-Mailer: UUPC/bsnews 2.1 modified
Lines: 42


>I have a .BAT file that I run under a Windows Icon.  I have set up a PIF
>file to run the BAT file in exclusive mode and to use the entire screen.
>The first line of the BAT file sets an environment variable.
>
>My problem is that on some of our machines , the SET command in the BAT file fails with the
>OUT OF ENVIRONMENT SPACE error.  I have raised the amount of environment
>space to 2048 bytes using the SHELL command in CONFIG.SYS so I know that
>I am nowhere near to running out. 

(From the Windows Resource Toolkit ), add an entry to
your "system.ini" file under the [NonWindowsApp] section:

    CommandEnvSize=NNNN

"This sets the COMMAND.COM env size, where NNNN must either be 0 or
between 160 and 32768.  A value of 0 disables the setting.  If this
value is too small or too big, it is rounded up to 160 or down to 32768.
If the value is less than the current size of the actual environment,
this setting is disabled, as if it were 0.  If you specify the
environment size in a PIF file for COMMAND.COM, the PIF setting
overrides this setting.  The default is 0 with MSDOS versions earlier
than 3.2.  Otherwise, the default value is the /e: option in the
SHELL= command in CONFIG.SYS.  To set this value, you must edit your
SYSTEM.INI [and reboot]."


I have used this entry, as well as relied on the default /e: from
the CONFIG.SYS shell= line, and both give larger environments.  If
you don't use one of these, then the environment passed by windows
to each new DOS box is just a little bit bigger than the environment
_variables_ present when windows was started.    This should allow your batch file to run,
but your mileage may vary.

--
Jerome  Schneider             Domain:  
Aspen Technology Group               UUCP:   {uunet}!csn!atglab!jls
PO Box 673, Ft. Collins, CO 80522    Voice:   484-1488

