MS-DOS-Based Application Runs out of Environment Space

Last reviewed: October 21, 1997
Article ID: Q84642

The information in this article applies to:
  • Microsoft Windows operating system versions 3.0, 3.0a, 3.1, 3.11

SUMMARY

If you receive the error message "not enough environment space" while running or attempting to run an MS-DOS-based application (also known as an MS-DOS virtual machine [VM]) under Microsoft Windows version 3.0 or 3.1, increase the environment space for this application.

MORE INFORMATION

When an MS-DOS-based application is executed, its environment space defaults to the MS-DOS default, which is 256 bytes.

Under Windows 3.0, the only way to increase the environment space in a VM is through the MS-DOS-based application's program information file (PIF). The following is a sample PIF file that does this:

    Field                   Information
    -----                   -----------

    Program Name            COMMAND.COM
    Program Title           My Program
    Optional Parameters     /E:2048 /C C:\MYDIR\MYPROG.EXE
    Startup Directory       C:\MYDIR

"/E:2048" is the size of the environment space in bytes; this value can range from 160 to 32,768.

"MYDIR" is the name of the directory that contains the executable of the program.

"MYPROG.EXE" is the name of the program.

With Windows 3.1, you can either use the above procedure to increase the size of the environment, or you can add the following line to the [NonWindowsApp] section in the SYSTEM.INI file:

   [NonWindowsApp]
   CommandEnvSize=2048

The above example sets a VM environment size of 2048 bytes. This value can range from 160 to 32,768.

Under Windows 3.1, the Environment size setting in the PIF file will override the CommandEnvSize= setting in the SYSTEM.INI file.

NOTE: The CommandEnvSize= line will automatically be placed in the SYSTEM.INI file when you install Windows 3.1 if there is a SHELL statement in the CONFIG.SYS. If there is no a SHELL statement, you will have to add this line to the SYSTEM.INI file.


KBCategory: kbenv kberrmsg
KBSubcategory: winmem win31 win30
Additional reference words: 3.00 3.10 non dos err msg win95 sms


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: October 21, 1997
© 1998 Microsoft Corporation. All rights reserved. Terms of Use.