MS-DOS 6.0 and 6.2: PATH Not Limited to 128 Characters

This article was previously published under Q97595
This article has been archived. It is offered "as is" and will no longer be updated.
In MS-DOS 6.0, 6.2, and 7.0 (included in Windows 95) the 128-character limitation of the MS-DOS PATHenvironment variable does not exist. To create a path with more than 128characters, use the PATH command in the CONFIG.SYS file instead of in theAUTOEXEC.BAT file.

NOTE: When setting the path in the CONFIG.SYS file, you must use a SETcommand. For example:
set path=c:\dos;c:\windows;
More information
There are some restrictions on this method of using PATH. Once you set thepath in the CONFIG.SYS file, you cannot change it later. You cannot use the%PATH% variable to append the path onto itself or run another batch file tomodify the path. If you do either of these, the path is truncated to thefirst 128 characters.

Also, some applications do not have the ability to use a long path. Forexample, the MS-DOS command SET does not display more than the first 128characters of the path. To see the complete path, use the OS option ofMicrosoft Diagnostics (MSD.EXE). If you have problems using a third-partyapplication and a long path, contact the manufacturer of the applicationfor possible solutions.

Paths Longer Than 256 Characters

There is one problem with paths longer than 256 characters. If you clearthe PATH variable with the SET command as follows
set path=
any characters beyond the 256-limit appear in your environment space,unassociated with any environment variables. For example, if you havea path of 260 characters, such as
and you clear it with the SET command, your environment space stillcontains the last four characters. If you type the SET command aloneto view your environment, you see something similar to the following:


Microsoft has confirmed this to be a problem in MS-DOS versions 6.0, 6.2,and 6.21. We are researching this problem and will post new informationhere in the Microsoft Knowledge Base as it becomes available.

If the Path Is in the CONFIG.SYS File

If you place the path statement in the CONFIG.SYS file, you may need tomanually update the path whenever you install a new program. Many softwarepackages use a setup utility to install the program to the hard disk drive.Generally, these setup utilities modify the AUTOEXEC.BAT file by adding adirectory name to the path statement. If the path statement is located inthe CONFIG.SYS file, the setup utility cannot find it and creates a newpath statement in the AUTOEXEC.BAT file. When the system is started, thepath in the AUTOEXEC.BAT file replaces the path loading from the CONFIG.SYSfile, leaving you with a path pointing to only one directory.

To work around this problem, each time you install a program, you must addthe program's directory name to the path in the CONFIG.SYS file and erasethe path line in the AUTOEXEC.BAT file.
maximum length w_bob win9x win95 win98

Article ID: 97595 - Last Review: 10/26/2013 12:14:00 - Revision: 2.0

  • Microsoft MS-DOS 6.0 Standard Edition
  • Microsoft MS-DOS 6.2 Standard Edition
  • Microsoft MS-DOS 6.21 Standard Edition
  • Microsoft MS-DOS 6.22 Standard Edition
  • kbnosurvey kbarchive kbdisplay kbenv KB97595