Associate a path with a drive letter

Use SUBST command…

[sourcecode language=”cpp”]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.[/sourcecode]

Type SUBST with no parameters to display a list of current virtual drives. An e.g. usage, create a  “p:” virtual drive for documents and settings folder path…

[sourcecode language=’cpp’]subst p: “C:Documents and Settings”[/sourcecode]

To delete an existing virtual drive use…

[sourcecode language=’cpp’]subst /D p:[/sourcecode]

To see all existing virtual drives created…

[sourcecode language=’cpp’]C:Documents and Settings>subst
N:: => C:
P:: => C:Documents and Settings[/sourcecode]

Also note that on machine restart these drives are not restored, for restoration after startup, create a batch file and put it into “Startup” folder in explorer. After a virtual drive is created, explorer shows this as an independent drive.

4 thoughts on “Associate a path with a drive letter

  1. Interestingly, you can subst a non-letter drive (e.g. 1: ), it won’t be displayed anywhere, but you can go to such drive by typing 1: .
    Some programs might get crazy when operating with files on such drive.

Appreciate your comments...