How ASSIGN Determines True Name of Disk Drive (49739)



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

This article was previously published under Q49739

SUMMARY

ASSIGN does not check the current name for the disk drive; instead, it retains the "true", original name of the disk drive for reassignment.

If floppy disk Drive A contains a single file named A.TXT and floppy disk Drive B contains a single file named B.TXT, the following commands cause the file B.TXT to be displayed in the directory:
   C> ASSIGN A=B
   C> DIR A:
The syntax documentation for the ASSIGN command can be checked to verify that this is what should happen. The first drive specified is the drive that MS-DOS normally reads and writes to. The second is the drive that you want MS-DOS to read and write to when the first drive is referenced.

It is not quite so intuitive how to restore A to A and B to B. The following example demonstrates how to ASSIGN the drive back to itself:
   C> ASSIGN A=A
After this command is issued, a DIRectory of Drive A displays the file A.TXT.

Modification Type: Major Last Reviewed: 11/26/2003
Keywords: KB49739