JSI Tip 4872. When you run MS-DOS applications, all MS-DOS environment variables are restricted to 128 characters?

The MS-DOS sub-system uses COMMAND.COM, which has a 128 character input buffer.

Actually, the maximum variable length is 127 characters, as the end-of-variable character takes 1 byte.

This limits the PATH environment variable to 122 characters, as PATH=  uses 5 characters.

To work around this limit, you can do any of the following:

1. Use short folder names. 

2. Use batch files that modify the PATH based on the application.

3. Use batch files that use fully qualified names.

4. If you have only one partition, eliminate the drive letter from the path.

5. Use the subst command to create drive letters for long path strings.

Hide comments


  • Allowed HTML tags: <em> <strong> <blockquote> <br> <p>

Plain text

  • No HTML tags allowed.
  • Web page addresses and e-mail addresses turn into links automatically.
  • Lines and paragraphs break automatically.