Out of Environment Space - how to fix.

Out of Environment Space - how to fix.

Post by Steven Tayl » Tue, 19 Aug 2003 11:18:47



Hi all, hope someone can help.

I have a batch file run everytime a program needs to be updated.   All
the batch file does is copy files from the network to the user's
computer.

Most computers that run the batch file have no problems.   In relation
to an odd few computers the same batch file reports an error,

"Out of Environment Space".

Is there a way to trap this error and secondly is there a way to
increase or set a value for environment space for the duration of the
batch file.

Thanks in advance

Steven Taylor
Melbourne, Australia.

 
 
 

Out of Environment Space - how to fix.

Post by Joe Batc » Tue, 19 Aug 2003 16:24:54



> Most computers that run the batch file have no problems.   In relation
> to an odd few computers the same batch file reports an error,

> "Out of Environment Space".

> Is there a way to trap this error and secondly is there a way to
> increase or set a value for environment space for the duration of the
> batch file.

You can use a recursive subroutine.


if goto:==%1 goto %2 (recursion handler)
call env.bat
:: following line handles subroutine (subroutine handler)
%comspec%/e:4096/c%0 goto: start
:: subroutine is finished
call env.bat
goto end

:start (subroutine code goes here)
call env.bat

:end
::

Screen output:

C:\BAT>bigenv.bat
Environment size is 2048 bytes
1694 bytes free in environment

Environment size is 4096 bytes
3742 bytes free in environment

Environment size is 2048 bytes
1694 bytes free in environment

Remove the lines with "call env.bat" and place your
batch code in the start module. I would imagine
4096 bytes is sufficient, increase if necessary.

I don't know how this will be run, but if there is a chance
of executing a .com or .exe file with the same basename
closer in the path than the running batch, you may need to
take precaution.

set ext=.bat
echo %0? |find/i ".bat?">nul
if not errorlevel=1 set ext=
%comspec%/e:4096/c%0%ext% goto: start

So....


if goto:==%1 goto %2 (recursion handler)
set ext=.bat
echo %0? |find/i ".bat?">nul
if not errorlevel=1 set ext=
:: following line handles subroutine (subroutine handler)
%comspec%/e:4096/c%0%ext% goto: start
:: subroutine is finished
goto end

:start (subroutine code goes here)

:end
::

--
 Batfiles: The DOS Batch File Programming Handbook & Tutorial
 http://purl.oclc.org/net/Batfiles/
 Using MS-Dos7 Commands http://purl.oclc.org/net/Msdos7/

 
 
 

1. How to fix "out of environment space"


It probably isn't...you need to use the line:

        shell=c:\dos\command.com c:\dos /e:1024 /p

In your config.sys file.  Shell identifies the command interpreter,
c:\dos\ is where the file is located (and where it should be
reloaded from when it gets overwritten in memory), 1024 is the size
of the environment space in bytes, and /p says that the first copy
of command.com loaded into memory should be permanent.

Change the c:\dos specifications if command.com is somewhere else,
and increase the 1024 if you still don't have enough space.

This command should work with DOS 3.3 or later.  To see which
version you are using, enter the ver command at a DOS prompt.


2. machinename parameter

3. How to fix "Out of environment space" error?

4. Looking for ka9q info

5. Removing directories w/ spaces FIXED

6. how connect a MOD

7. Wasted disk space fix wanted

8. Speedometer on a IIsi

9. Out of environment/alias space

10. out of environment space

11. "Out of environment space" in DOS mode

12. OUT OF ENVIRONMENT SPACE

13. out of environment space