Home > Commands A-M > Commands A

ASSIGN


Description | Syntax | Parameters | Switches | Related | Notes | Examples | Errorlevels | Availability

Redirects requests for disk read/write operations on one drive to a different drive.

Lets you use a drive other than the one the operating system normally uses when it writes to a file or reads from a file. Some application programs use only drive A: with the Assign command you could make drive C: the drive used by the application. Assignments stay in effect until you change them or turn your computer off.

This command is part of the supplemental programs beginning with (MSDOS6.00)


Syntax

ASSIGN [x[:][=]y[:][...]]

ASSIGN [/STA[TUS]]

To reset all drive letters to original assignments.

ASSIGN


Parameters
x (v3.0)
Specifies the drive letter to reassign.
y (v3.0)
Specifies the drive that x: will be assigned to.

Switches
/STA[TUS] (v5.0)
Displays current drive assignments. Can abbreviate as /S?

Related

Replaced by SUBST.


Notes

This command is especially useful when you are using a program that automatically attempts to read or write to a specified drive. By reassigning that drive letter, you tell the operating system to ignore requests to the first drive letter and instead carry out both reads and writes on the second drive letter. When you want the operating system to again carry out drive requests as usual, enter ASSIGN without any options.

You can use this command with application programs that attempt to act on drives you don't want to use (or don't have installed in your computer).

This command should not be used with other operating system commands that need to get drive information. The FORMAT, DISKCOPY and DISKCOMP will ignore any drive reassignments. Also, don't use the BACKUP, RESTORE, LABEL, JOIN, SUBST, or PRINT COMMANDS with redirected drives.


Examples
    ASSIGN A=B

DOS sends any requests for drive A to drive B. After this form of the command is entered, the command:

    DIR A:

will result in a display of the files on drive B instead of drive A.


You can reassign more than one drive at a time (leave a space between entries). For example, enter:

    ASSIGN A=B C=B

Requests for either drive A or drive C would automatically be sent to drive B.


For example, if you enter:

    DIR A:

DOS will display a directory of the files on drive B (not of drive A).


Enter:

    ASSIGN /STA

and a report of the assigned drives will be displayed:

    Original A: set to D:
    Original B: set to D:

Errorlevels

none.


Availability
External
DOS
v2.0 v2.01 v2.05 v2.10 v2.11 v2.11R v2.12 v2.2 v2.25 v3.0 v3.20 v3.05 v3.1 v3.21 v3.25 v3.30 v3.3A v3.3R v3.3T v3.31 v3.40 v4.0 v4.01 v4.01A v5.0
Windows
none
Windows NT
none