Substitute a drive letter for a network or local path.

      SUBST drive_letter: path


      SUBST drive_letter: /D

   SUBST with no parameters will display current SUBST drives

   /D    Delete the drive_letter substitution.

The SUBST command can be used to map a drive letter to a LOCAL folder on the same machine.

When a Substed drive is used to delete files or folders, that action will bypass the recycle bin. It will act like a network drive.

SUBST does not have any options to persist after a reboot or logoff, but you can re-initialise the substitution using a one line batch file in the Windows Startup folder or via a logon script.

If you map a drive with the NET command, use the NET command to remove it, similarly if you substitute a drive letter with SUBST then use the SUBST command to remove it.

If the network resource is unavailable (i.e. the server is down) SUBST will continually retry, unlike NET USE which will try to connect once and fail. SUBST is generally used against a local drive path where this is unlikely to be a problem.

Subst for an elevated process

If a drive is mapped or Subst'd from an elevated prompt, it will be invisible to any non-elevated process.

Error: Path not found

Subst will return a 'path not found' error if the path includes a trailing backslash.

SUBST Z: C:demo\files\ ➞ will fail
SUBST Z: C:demo\files ➞ will work

Undocumented behaviour

If a drive is substed using characters other than A-Z ($,#, :, !, 0-9) it will not appear in Windows Explorer or in the drives reported by SUBST. In early versions of Windows, SUBST also provided some drive mapping options that are now covered by NET USE. In early versions of Windows, SUBST would create a RECYCLER for each Substed drive.


Substitute the drive letter P: for the path D:\work files\April\ :

C:\> subst p: D:\work files\April

Remove the drive substitution from P: this does not remove any files:

C:\> subst p: /d

Map the drive letter O: to a local OneDrive for Business folder:

C:\> subst O: C:\Users\Tanisha\OneDrive

"A man should never be ashamed to own he has been in the wrong, which is saying in other words, that he is wiser today than he was yesterday" ~ Alexander Pope (thoughts on various subjects)

Related commands

NET USE - Map a drive letter to a network drive.

Copyright © 1999-2024
Some rights reserved