How to Make a Virtual Drive on Windows Based on a Directory Using SubSt Command ?


On windows command shell, there is a command subst which can be used to make a virtual drive that links to a directory. The usages of this command are:

C:\Windows\system32>subst /?
Associates a path with a drive letter.

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

  drive1:        Specifies a virtual drive to which 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.

For example,

C:\>subst z: E:\temp

Then, we have a Z virtual drive that is actually the shortcut to folder E:\temp.

We can use

subst /d Z:

to remove this virtual drive. If you try to remove non-virtual drive, it will print:

D:\>subst /d c:
Invalid parameter - C:

If drive is already substed it says:

Drive already SUBSTed

–EOF (The Ultimate Computing & Technology Blog) —

GD Star Rating
loading...
223 words
Last Post: The Javascript Function to Compute the Stamp Duty Tax
Next Post: SQL Coding Exercise - Consecutive Numbers

The Permanent URL is: How to Make a Virtual Drive on Windows Based on a Directory Using SubSt Command ?

Leave a Reply