Microsoft KB Archive/52194

From BetaArchive Wiki

DIR Malfunctions if Switch Is Before Target Directory PSS ID Number: Q52194 Article last modified on 07-14-1993 PSS database name: O_MSDOS

4.00 4.01 4.01a

MS-DOS

The information in this article applies to:
- Microsoft MS-DOS operating system versions 4.x

Summary:

When the MS-DOS versions 4.x DIR command is used with an optional switch before a target directory that is on a drive other than the current drive, DIR produces a directory listing of the current directory rather than of the target directory.

A side effect of this is that the current directory of the target drive is changed to the directory specified in the target parameter of DIR.

More Information:

This problem can be reproduced using the following commands (assuming a floppy disk is in drive A and a C:subdirectory exists on the hard disk):

Command Comments ——- ——–

a: Make A: the current drive.

cd c:  Change to the root directory of C:.

dir c: Show a directory of the current C: directory (C:).

dir /w c:Attempt to show a wide directory of C:; you get A:.

dir c: Show a directory of the current C: directory (C:).

The last DIR C: command should produce a directory listing of the root directory of drive C, just as the first DIR C: command did; however, the current directory of drive C was implicitly changed by the DIR command, and the DIR command did not produce the proper directory listing.

Please note that the same command functions are expected when the /W option is placed after the target directory parameter.

Microsoft has confirmed this to be a problem in MS-DOS versions 4.0, 4.01, and 4.01a. This problem does not occur in later versions of MS-DOS.

Additional reference words: 4.00 4.01 4.01a noupd

Copyright Microsoft Corporation 1993.