Error Messages Caused by DIRCMD (72487)

The information in this article applies to:
    Microsoft MS-DOS operating system 5.0
    Microsoft MS-DOS operating system 5.0a
    Microsoft MS-DOS operating system 6.0
    Microsoft MS-DOS operating system 6.2
    Microsoft MS-DOS operating system 6.21
    Microsoft MS-DOS operating system 6.22

This article was previously published under Q72487


There are two error messages that can be caused by incorrectly setting DIRCMD options:

Path not found


Too many parameters - X
(Error occurred in the environment variable)


DIRCMD allows you to "program" the DIR command. DIRCMD is an MS-DOS environment variable and can be set from the command line or the AUTOEXEC.BAT file. However, because it is a true environment variable, it can also be set to any ASCII string. All subsequent DIR commands will reference DIRCMD until reset or changed. If DIRCMD is improperly set, it can result in "odd" effects or error messages.

The following are examples of errors caused by incorrectly setting DIRCMD:

Example 1: set DIRCMD=\O\L

The use of backslashes instead of forward slashes will typically display the "Path not found" error message because MS-DOS searches for files in the "L" subdirectory under the "O" subdirectory.

Example 2: set DIRCMD=O;L

MS-DOS will interpret "O" and "L" to be filenames. In addition, if file "O" is not found, MS-DOS will look at the "L" entry and give the following error message:

Too many parameters - L
(Error occurred in environment variable)
In both cases, the files in the current directory will not be listed. This behavior continues until DIRCMD is reset.

Modification Type: Major Last Reviewed: 5/12/2003
Keywords: KB72487