ARCHIVED: How and when would I want to use the DOS command subst?

This content has been archived, and is no longer maintained by Indiana University. Information here may no longer be accurate, and links may no longer be available or reliable.

Use the subst command when you want to refer to a directory as a virtual drive. This command is available in DOS versions 3.1 and higher. The syntax is as follows, where x represents any letter (a through z) that you would like to name the substituting drive (this cannot be the default drive):

  subst [x:] [x:path] [/D]

Notes:

  • x: specifies the drive letter that you want to use as a substitute for a particular drive and path.
  • x:path specifies the drive letter and path that you want to refer to with the new drive name.
  • You can report any substituted drives by entering subst by itself.
  • /D deletes a substitution. You must also specify the drive letter of the drive whose substitution you want to delete.
    • Entering this line would allow you to treat c:\temp as a drive name x:
        x: c:\temp
    • Entering this line would allow you to delete the x: substitution:
        subst x: /D
    Deleting this substitution will not delete or alter the contents of c:\temp in any way.

This is document adju in the Knowledge Base.
Last modified on 2018-01-18 10:49:55.