Increase MS-DOS 6.22 Shell Memory
In MS-DOS 6.22, running complex batch files or declaring numerous
system variables can trigger the common "Out of environment space"
error. This article explains how to increase the command line shell's
environment memory by modifying the CONFIG.SYS file. By
configuring the SHELL statement with the /E
switch, you can allocate the necessary memory for your command
interpreter needs.
The Configuration Parameter
To increase shell environment memory, use the SHELL
command in CONFIG.SYS alongside the /E:
switch. The /E: switch directly controls the number of
bytes reserved for the environment space used by
COMMAND.COM.
The standard syntax is:
SHELL=C:\DOS\COMMAND.COM C:\DOS\ /E:size /P
Breakdown of the Syntax
C:\DOS\COMMAND.COM: Specifies the path to the command interpreter file.C:\DOS\: Specifies whereCOMMAND.COMshould look to reload itself if transient portions of memory are overwritten by applications./E:size: The specific parameter that dictates the memory allocation in bytes. The valid range is from160to32768. The default allocation in MS-DOS 6.22 is 256 bytes. Common allocations to resolve memory issues are1024(1 KB),2048(2 KB), or4096(4 KB)./P: Tells MS-DOS to make this instance ofCOMMAND.COMpermanent. Without/P, the shell will not automatically executeAUTOEXEC.BAT, and typingEXITcould crash the system.
How to Apply the Setting
- Open the MS-DOS text editor by typing
EDIT C:\CONFIG.SYSat the command prompt. - Locate any existing line beginning with
SHELL=. If it does not exist, add a new line to the file. - Set the line to allocate your desired memory size. For example, to set the environment size to 1,024 bytes:
SHELL=C:\DOS\COMMAND.COM C:\DOS\ /E:1024 /P
- Save the changes to
CONFIG.SYSand exit the editor. - Reboot the computer for the changes to take effect.