Jun 21, 2007 -- posted by TechMonk
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:
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:
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.