Map a Drive Letter to a Folder the Easy Way in Windows
Have you ever needed to repeatedly access a folder that is nested deep inside a giant hierarchy of folders? Sure, you can always create a shortcut to that folder, but did you know you can actually assign a drive letter to a folder instead? Today we’ll show you how to do this.
This ability has existed in Windows via the subst command for quite a while, so this will also work for you XP users as well.
Map a Drive Letter the Easy Way
The easiest way to assign a drive letter to a folder is to use a simple utility called Visual Subst, which gives you a nice graphical interface to assign drive letters, but also does something that the command line version can’t… you can set your virtual drives to apply again at startup.
You can download and run the utility without needing to install it, and then simply use the Browse button to select your path, and click the green plus symbol after choosing the drive letter.

At this point you should see the drive letter show up in the list. (Note that you can delete it by highlighting and choosing the red X icon, or change the path / letter by using the Save button.
If you want to save the drives, you’ll want to select the “Apply virtual drives on Windows startup” option.
Now when you open up your Computer window, you should see the new drive show up in the list.
The contents of the new M: drive will actually be the contents of my desktop folder.
Download Visual Subst from ntwind.com
Assign Drive Letters from the Command Prompt
If you are more the keyboard ninja type, or just want to know how to use the command line version, you can use the subst command to map drive letters the same way by using the following syntax:
subst <driveletter> <folder path>
For example, to map the M: drive to my desktop folder I would use the following command:
subst M: c:\users\geek\desktop
If you just want to see which drive letters are assigned, you can use subst without any arguments, as shown here:
To delete a drive letter you can use the /D switch instead of a path… for instance, to delete the M: drive that I just created, I would use the following syntax:
subst M: /D
Now when you use the subst command to see the current drives, you’ll see nothing in the list.
I’ve found the subst command to be very useful, not just in shortening folder paths but also in one instance where I wanted to delete my second partition… I just reassigned the D: drive letter to point to C: and copied all the data over. That way the application shortcuts still worked without having to reinstall the application.

Daily Email Updates
You can get our how-to articles in your inbox each day for free. Just enter your name and email below:


You can write a quick batch and add a shortcut to the start up.
Quite nice tool, but it shows the free space of the new drive equal to the original drive than the size of the folder on which the new drive points. Is that a bug?
Being a PC user since the early 80’s, I had been using this SUBST command for a long time. There is nothing new about this. And rather than using this GUI, I’d just use the command line.
And now that I’m away from Windows, I use symlinks instead, under Linux. Linux rocks !!!!!
@Jean-Francois
You can actually use symlinks in Vista now as well:
http://www.howtogeek.com/howto.....ows-vista/
@satansoldier
Once it is mapped via command prompt then the mapping stays there even after reboot. No need to run a single BAT file at startup over and over.
I personally don’t like drive mappings. Would rather use shortcuts to UNC path.
The last time I use used the subst command, it didn’t persist past reboot.
I would guess the apply on startup command in that program just reruns the subst command on startup.
My post about a batch at startup was to combat “does something that the command line version can’t… you can set your virtual drives to apply again at startup.”
@jd2066
You’re right, I’m thinking of the NET USE command. Which can work in a similar way. Just share out a folder on your hard drive and map to it with the NET USE command. You can use your own computer name when doing so. It will persist past reboot.
http://technet.microsoft.com/e.....90717.aspx
This program made photoshop loose the path to all it’s photos. It keeped thinking that my photos were on Z drive where my downloads actually were.
What happens if you delete the folder (because you don’t need it anymore!)?
If you didn’t want to create a *.cmd or *.bat script file you could also create a shortcut with the following as the “target”/”Location”
%COMSPEC% /C “SUBST M: D:\MyFolder >NUL 2>&1″
Note the quotes. Use whatever you like as the shortcut name. After it is created, use the shortcut properties (right-click on the shortcut and select “Properties”) to change the shortcut “Icon” if you want. Also, if you don’t like the “flash” that occurs when you open the shortcut properties and change the box “Run:” to “Minimized”.
This shortcut will invoke the shell (Windows command processor) and execute the SUBST command. The ” >NUL 2>&1″ throws away any messages that the SUBST command may generate.
Then you can independently copy/move the shortcut to anywhere (desktop, quick launch, start menu…) and not be tied to the location of a script file. For example, if you placed the shortcut in your “start” folder then the drive would be created every time you login.
If you REALLY want to get fancy you could create a shortcut “toggle” by using the following as the “location”/”target”
%COMSPEC% /C “IF exist M:\ ( SUBST M: /D >NUL 2>&1 ) ELSE ( SUBST M: D:\MyFolder >NUL 2>&1 )”
Every time you double click on the shortcut it will delete “M:” if the drive exists, otherwise it will create it.
I just thought of a RELLY fancy “toggle”. This reports the status of your drive (deleted or dreated). Change your “location”/”target” to:
%COMSPEC% /C “IF exist M:\ ( SUBST M: /D & ECHO Drive M: deleted & SUBST & pause ) ELSE ( SUBST M: D:\MyFolder & SUBST & pause )”
Of course, to see the results, your shortcut properties “Run:” window must NOT be set to “Minimized”.
I have found (at least in my system – win xp -) that Subst mess up with the attribution of the drive letter if you insert a removable drive AFTER you issue the subst command.
Let’s say that your subst target is F:, and the next available drive letter (before subst) is F:: when you plug-in the device, Windows will associate the letter F: to the device but you can’t see the removable drive content beacuse is “hidden” by the SUBST drive letter target. You have to SUBST /D in order to see the removable drive. I have to remember to not target the next free drive letter with subst to circumnavigate the problem.
Paul,
I have also seen that problem with NET USE or windows sharing drives. It’s a generic bug in XP, simple solution is exactly as you stated, just assign letters to static things further down the alphabet.