Applies To: Windows Server 2003, Windows Server 2003 R2, Windows Server 2003 with SP1, Windows Server 2003 with SP2


Associates a path with a drive letter. Used without parameters, subst displays the names of the virtual drives in effect.


subst [Drive1**:** [Drive2**:**]Path]

subst Drive1 : /d

  • Drive1 :
    Specifies the virtual drive to which you want to assign a path.
  • Drive2 :
    Specifies the physical drive that contains the specified path (if different from the current drive).
  • Path
    Specifies the path that you want to assign to a virtual drive.
  • /d
    Deletes a virtual drive.
  • /?
    Displays help at the command prompt.
  • The following commands do not work, or should not be used, on drives used in the subst command:

    • chkdsk

    • diskcomp

    • diskcopy

    • format

    • label

    • recover

  • The Drive1 parameter must be within the range specified by the lastdrive command. If not, subst displays the following error message:

    Invalid parameter - drive1:


To create a virtual drive Z for the path B:\User\Betty\Forms, type:

subst z: b:\user\betty\forms

Now, instead of typing the full path, you can reach this directory by typing the letter of the virtual drive, followed by a colon, as follows:


Formatting legend

Format Meaning


Information that the user must supply


Elements that the user must type exactly as shown

Ellipsis (...)

Parameter that can be repeated several times in a command line

Between brackets ([])

Optional items

Between braces ({}); choices separated by pipe (|). Example: {even|odd}

Set of choices from which the user must choose only one

Courier font

Code or program output

See Also


Command-line reference A-Z
Command shell overview