Windows : Map a Path to a Drive letter
Ever wondered if you could assign your favorite directories lying deep under a large chain of directories, as seperate drives?
This post is going to tell you how to refer to a path like “D:\workspace\topcoder\development\javaprojects\” as simply “T:”
First let me tell you the manual way of doing it using the command prompt.
Suppose the path is “D:\workspace\topcoder\development\javaprojects\” and we want it to map to a drive letter say “T:”, then all we need to do is to open the command prompt and type the following command.
subst T: "D:\workspace\topcoder\development\javaprojects\"
Now, instead of typing the full path, you can reach this directory by typing the letter of the virtual drive, followed by a colon, as follows:
T:
You will see that a new drive entry is created under your “My Computer” as “T:” which maps to the desired folder. After doing this we can refer to a path like “D:\workspace\topcoder\development\javaprojects\ProjectABC” as simply “T:\ProjectABC\”
If you want to delete this drive then just issue the following command.
subst T: \d
Points to remember:
- This is not a permanent mapping as the mapping will be lost after you restart windows or log off. (You can create a batch file for this and put it on startup to have your drive everytime you log on to windows. Read further to know how to avoid this.)
- The commands like chkdsk, diskcomp, diskcopy, fomrat, label and recover, do not work and should not be used on drives created with subst command.
- To see more details of the command. Type:
subst /?
Now, for the people who hate command line stuffs, there’s a nice little tool available called Visual Subst. It uses the API similar to the console ’subst’ utility, but makes it easier to create and remove virtual drives in a GUI way. This tool also allows you to persist the virtual drive mapping on windows restart.

Note: This works with Windows 2000/XP as well as Windows Vista platforms.
Extra Note (Added for my own safety) : I am not responsible if anything goes wrong, while trying out the commands or softwares presented here.
6 comments so far
Leave a reply




Hey nice post man, but authors name is not visible…
I can guess who it is but its better to keep the name…
what about mapping a physical partition as a folder and NOT as a drive, i think that is useful too.
I have been trying to find a way of mapping a folder on Linux to a drive, but have been unsuccessful so far. Can you help me with this?
*rofl*
i am quite bored..
im ur most loyal visitor on this website.. that may or may not be related to the cause that i am highly vella
@DarK… Mapping a physical partition as a folder can be achieved (under Win2k and WinXP) by going to the Management Console (My Computer -> Manage), Disk Management, right-click on the partition and select “Change drive letter and path…”. You can then define an empty folder which will appear to hold the contents on the partition (instead of a drive letter).