Friday, March 22, 2013

How do you mount a directory as a drive in Windows 7?

How do you mount a directory as a drive in Windows 7?
---------------------------------------------------------
If you have touched DOS before, you might still remember what this old school command subst

is all about. It is a command used for substituting local paths on physical and logical

drives, known as virtual drives. For example, if you want to have a logical drive N: mapped

to a local folder on your computer, say c:\temp, you can simply use the following command to

make it.

    subst N: c:\temp

If you want to have it permanent, there is a really nasty and hidden trick, creating a new

key in the registry.

You have to go to

HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices

and there create a key named with the drive letter you want, colon included
(N: in our example) and with this value:

\??\c:\\windows


you can obviously change c: and windows for whatever folder you want, but remember to double the backslash after the unit letter, because it won’t work with a single backslash.
Reboot and enjoy your new N: :)

To Delete the subst drive

subst X: /d


TIP:
There is also a great freeware utility called Visual Subst to make things even easier:












No comments:

Post a Comment