Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

out of environment space?

500 views
Skip to first unread message

Kim Tolstrup & Trine Grønborg Christensen

unread,
Jun 30, 1998, 3:00:00 AM6/30/98
to

Hi There!

What does "Out of environment space" mean? How do I get more?

The problem arise when I run a directx setup BAT file.

Please help a newbie...

Thanks... Kim...


mjg...@mindspring.com

unread,
Jun 30, 1998, 3:00:00 AM6/30/98
to

Kim Tolstrup & Trine Grønborg Christensen wrote in message
<3599589E...@get2net.dk>...

Environment space is simply a space to store variables, like the dos PATH
statement...

If you type SET from a dos prompt, all that is displayed is environment
variables, which is placed in the
environment....

You could do this within a batch file:

@echo off
Set NAME=Michael
Echo Hello %NAME%! How are you today....
Echo.
Echo Your current PATH is:
Echo %PATH%

The %PATH% and %NAME% are environment variables....

To increase the size of your environment, try looking at the COMMAND help
screen by typing:

COMMAND /?

From a Dos Box...

Example line placed in your CONFIG.SYS:

SHELL=C:\COMMAND.COM C:\ /E:4096 /P

This will allocate 4096 bytes of environment space.....

Hope this helps....

Timo Salmi

unread,
Jul 2, 1998, 3:00:00 AM7/2/98
to

In article <3599589E...@get2net.dk>,
Kim Tolstrup & Trine Grønborg Christensen <ktc...@get2net.dk> wrote:
:What does "Out of environment space" mean? How do I get more?

:The problem arise when I run a directx setup BAT file.

A draft item for the next version of

148464 Jun 20 1998 ftp://garbo.uwasa.fi/pc/ts/tsbat55.zip
tsbat55.zip A collection of useful batch files and tricks, T.Salmi

D9. What does "Out of environment space" mean? How do I get more?
=================================================================

It means just that. You have run out of space for the environment
variables in your batch. It will (usually) not work correctly then.
By default MS-DOS allocates (only) 256 bytes for the environment
variables. You can alter the environment space to be from 160 to
32768 bytes. Put e.g. the following line into your CONFIG.SYS file
to increase the environment size
SHELL=C:\DOS\COMMAND.COM /P /E:1024
If you are running MS-DOS in a Windows 3.1x dosbox you may need to
add the following directive to the SYSTEM.INI file
[NonWindowsApp]
CommandEnvSize=1024
If you wish to check your environment space consumption, please see
the item "25) How can I test if my batch has sufficient environment
space?" in 1BATFAQ.TXT.

All the best, Timo

....................................................................
Prof. Timo Salmi Co-moderator of news:comp.archives.msdos.announce
Moderating at ftp:// & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland

Spam foiling in effect. My email filter autoresponder will return a
required email password to users not yet in the privileges database.


Brad Thone

unread,
Jul 4, 1998, 3:00:00 AM7/4/98
to

On Stardate 2 Jul 1998 08:04:48 +0300, t...@majakka.uwasa.fi (Timo Salmi)
scribbled:

>In article <3599589E...@get2net.dk>,
>Kim Tolstrup & Trine Grønborg Christensen <ktc...@get2net.dk> wrote:
>:What does "Out of environment space" mean? How do I get more?
>:The problem arise when I run a directx setup BAT file.
>

>It means just that. You have run out of space for the environment
>variables in your batch. It will (usually) not work correctly then.
>By default MS-DOS allocates (only) 256 bytes for the environment
>variables. You can alter the environment space to be from 160 to
>32768 bytes. Put e.g. the following line into your CONFIG.SYS file
>to increase the environment size
> SHELL=C:\DOS\COMMAND.COM /P /E:1024
>If you are running MS-DOS in a Windows 3.1x dosbox you may need to
>add the following directive to the SYSTEM.INI file
> [NonWindowsApp]
> CommandEnvSize=1024
>If you wish to check your environment space consumption, please see
>the item "25) How can I test if my batch has sufficient environment
>space?" in 1BATFAQ.TXT.
>
> All the best, Timo

Here's my solution for nearly guaranteeing enough environment space exists for
a batch file to run properly. Haven't tried this for NT yet, though.

@ECHO OFF
REM This batch file is called TEST.BAT
IF .%1.==.GOTMORE. GOTO CONTINUE
COMMAND /E:4096 /C TEST.BAT GOTMORE %1 %2 %3 %4 %5 %6 %7 %8 %9

:CONTINUE
SHIFT
REM Set environment variables here and do your thing
.
.
GOTO END

:END
EXIT
REM Upon Exit, environment variables are cleared for you

Brad Thone

Brad Thone, speaking only for himself
Remove "-" at start of address to reply.
Proper gun use SAVES lives and preserves/restores freedom!
"...shall not be infringed."
Per 47 USC Sec 227 unsolicited email sent to me
may be subject to a $500 fee!
http://www.law.cornell.edu/uscode/47/227.html

Timo Salmi

unread,
Jul 4, 1998, 3:00:00 AM7/4/98
to

148464 Jun 20 1998 ftp://garbo.uwasa.fi/pc/ts/tsbat55.zip
tsbat55.zip A collection of useful batch files and tricks, T.Salmi

25. How can I test if my batch has sufficient environment space?
================================================================

If your batch utilizes environment variables there is a possibility
that you run out of environment space. If you get an "Out of
environment space" message the well-known trick to increase your
environment space by using shell configuration in config.sys:
Example: shell=c:\bin\command.com c:\bin /e:1024 /p

A perhaps less-known trick is that you can test in advance if your
batch will run out of environment space. Below is an example showing
you how to test if you have an additional 32 bytes of environment
space still available for your batch:
@echo off
set test_=12345678901234567890123456789012
if "%test_%"=="12345678901234567890123456789012" goto _yes
echo Insufficient environment space
goto _out
:_yes
echo Sufficient environment space
set test_=
rem Whatever you wish to do
:_out
To test more extensively you can use
@echo off
for %%f in (a b c d e f g h i j k l m n o p q r s t u v x y z)
do set %%f=12345678901234567890123456789012345678901234567890
set
echo "%z%"
if "%z%"=="12345678901234567890123456789012345678901234567890" goto _yes
echo Insufficient environment space
goto _out
:_yes
echo Sufficient environment space
:_out
Note! The "for" and "do" should go on the same line but have been
wrapped for legibility because of the right margin.
If you want to know what your initial environment size is, you
can use a program like SYSINFO.EXE from
148195 May 17 1998 ftp://garbo.uwasa.fi/pc/ts/tsutil44.zip
Timo's 1st utility set (sysinfo,dirw,dtetimal,timelog,...)
or whatever is the current version number of the package.

Kim Tolstrup & Trine Grønborg Christensen

unread,
Jul 7, 1998, 3:00:00 AM7/7/98
to

Thank you all of you!!

Everything works just fine now :O)

Regards Kim...

0 new messages