The Effect of Replacement Parameters in PATH Statement (61925)



The information in this article applies to:
    Microsoft MS-DOS operating system 3.1
    Microsoft MS-DOS operating system 3.2
    Microsoft MS-DOS operating system 3.21
    Microsoft MS-DOS operating system 3.3
    Microsoft MS-DOS operating system 3.3a
    Microsoft MS-DOS operating system 4.0
    Microsoft MS-DOS operating system 4.01
    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 Q61925

SYMPTOMS

You may receive the "Incorrect DOS Version" error if you execute an MS-DOS command (MODE, for example) and your AUTOEXEC.BAT file has two PATH statements similar to the following:
   PATH=C:\DOS;
   PATH=C:\P3;%PATH%
Recopying the MODE.COM file from your MS-DOS floppy disk to your DOS subdirectory does not correct the error.

CAUSE

This problem occurs because MS-DOS is looking for the command in the wrong directory.

RESOLUTION

To correct this problem, you need to rewrite your PATH statement.

MORE INFORMATION

When your AUTOEXEC.BAT file is run, the path is set to C:\DOS (the DOS subdirectory). When it executes the second path statement (PATH=C:\P3;%PATH%), the path is reset to C:\P3 (the P3 subdirectory) and the C:\DOS path is appended to this. When the AUTOEXEC.BAT file is finished running, your path is set to C:\P3;C:\DOS, in this order.

When you issue a command (in this case, the MODE command) with the above path set, MS-DOS searches the current directory. If the command isn't found in the current directory, MS-DOS searches the P3 subdirectory. If the command still isn't found, MS-DOS searches the MS-DOS subdirectory.

The "Incorrect DOS version" error occurs because there is a MODE command in your P3 subdirectory. When the MODE command is issued, MS-DOS is finding the MODE command in the P3 subdirectory rather than the MODE command in the DOS subdirectory. To avoid this, you can do either of the following:
    Combine the two PATH statements so that one of them reads as follows
          PATH=C:\DOS;C:\P3;
    
    then delete the second PATH statement. -or-


    Change the second PATH statement to read as follows:
          PATH=%PATH%;C:\P3
    
Either of these solutions forces MS-DOS to search the DOS subdirectory before the P3 subdirectory.

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