Microsoft DOS subst command

Updated: 11/13/2018 by Computer Hope

About subst

Allows you to substitute a folder on your computer for another drive letter.


The subst command is an external command that is available in the below Microsoft operating systems as subst.exe.

Subst syntax

Associates a path with a drive letter.

SUBST [drive1: [drive2:]path]
SUBST drive1: /D

drive1: Specifies a virtual drive you want to assign a path.
[drive2:]path Specifies a physical drive and path you want to assign to a virtual drive.
/D Deletes a substituted (virtual) drive.

Type SUBST with no parameters to display a list of current virtual drives.

Subst examples

subst a: .

Sets the current directory and subdirectories as the A: drive. So, if you were to type A: after doing this command you would see everything in the directory from where the command was ran.

If you reboot the computer any subst command is cleared unless command placed into the autoexec.bat or other location that is executed upon starting the computer.

Tip: You cannot subst network drives and after a drive has been created you cannot give the new drive a new label.