PRB: "Out of Environment Space" Error When Using RUN Command

Last reviewed: April 17, 1995
Article ID: Q101596
The information in this article applies to:
  • Microsoft FoxPro for MS-DOS, versions 2.0, 2.5, and 2.5a

SYMPTOMS

You receive an "Out of Environment Space" error message when you are using a RUN command in FoxPro to execute a batch file or program that issues SET commands or other commands that take up environment space.

CAUSE

When the FoxPro RUN command is issued, it has a default of 256 bytes of environment space. After this 256 bytes is used up, an "Out of Environment Space" error message is displayed.

RESOLUTION

Issue the RUN command in the following form:

   RUN c:\command.com /e:<nnnnn> /c <string>

The /e:<nnnnn> parameter specifies the environment size; increasing this parameter (for example, to 2048) will cause the "Out of Environment Space" message to disappear. The /c <string> parameter specifies that the command interpreter is to perform the command specified by <string> and then stop.

MORE INFORMATION

Increasing the /e: parameter on a SHELL statement has no effect on the above error message because when an MS-DOS virtual machine (VM) is started, it does not inherit the settings from the SHELL statement in the CONFIG.SYS; thus, it is necessary to directly specify the environment space needed when starting the MS-DOS shell.

Steps to Reproduce the Problem

  1. Create a batch file called TEST.BAT and input the following:

          SET test1=1
          SET test2=2
          SET test3=3
          SET test4=4
          SET test5=5
          SET test6=6
          SET test7=7
          SET test8=8
          SET test9=9
          SET test10=10
          PAUSE
          SET test11=11
          SET test12=12
          SET test13=13
          SET test14=14
          SET test15=15
          SET test16=16
          SET test17=17
          SET test18=18
          SET test19=19
          SET test20=20
          PAUSE
          SET test21=21
          SET test22=22
          SET test23=23
          SET test24=24
          SET test25=25
          SET test26=26
          SET test27=27
          SET test28=28
          SET test29=29
          SET test30=30
          PAUSE
          SET test31=31
          SET test32=32
          SET test33=33
          SET test34=34
          SET test35=35
          SET test36=36
          SET test37=37
          SET test38=38
          SET test39=39
          SET test40=40
          PAUSE
    

  2. Issue the following command in the Command window:

          RUN c:\test.bat
    

    Note that after the SET test4=4 statement is executed that an "Out of Environment Space" error message is displayed.

  3. In the CONFIG.SYS file, change the /e:<nnnnn> environment setting to be twice its current value. Repeat step 2. Note that an "Out of Environment Space" error message is still displayed.

  4. Issue the following command in the Command window:

          RUN c:\command.com /e:2048 /c c:\test.bat
    

    Note that the "Out of Environment Space" error message is no longer displayed.


Additional reference words: FoxDos 2.00 2.50 2.50a errmsg err msg
KBCategory: kbprg kberrmsg kbprb
KBSubcategory:


THE INFORMATION PROVIDED IN THE MICROSOFT KNOWLEDGE BASE IS PROVIDED "AS IS" WITHOUT WARRANTY OF ANY KIND. MICROSOFT DISCLAIMS ALL WARRANTIES, EITHER EXPRESS OR IMPLIED, INCLUDING THE WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. IN NO EVENT SHALL MICROSOFT CORPORATION OR ITS SUPPLIERS BE LIABLE FOR ANY DAMAGES WHATSOEVER INCLUDING DIRECT, INDIRECT, INCIDENTAL, CONSEQUENTIAL, LOSS OF BUSINESS PROFITS OR SPECIAL DAMAGES, EVEN IF MICROSOFT CORPORATION OR ITS SUPPLIERS HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH DAMAGES. SOME STATES DO NOT ALLOW THE EXCLUSION OR LIMITATION OF LIABILITY FOR CONSEQUENTIAL OR INCIDENTAL DAMAGES SO THE FOREGOING LIMITATION MAY NOT APPLY.

Last reviewed: April 17, 1995
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.