Map a fake drive letter to a folder with subst.exe

We all know that aberration called “Drives letters” in Windows, a present from the old DOS days. So, maybe you are interested in how to map a fake drive unit (let’s say N:) to an existent folder (for example, C:\Windows).

It’s really easy with substr.exe, all you have to do (once you know this program does exist, naturally) is:

subst N: C:\windows

now if you enter in N: you will see the Windows folder’s contents. This is done on a per-user basis (every user can have its N: pointing to a different directory) and it disappears on the first reboot.
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: :)

Advertisement

10 thoughts on “Map a fake drive letter to a folder with subst.exe

  1. How would i do this for a network path?
    eg:
    HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\DOS Devices
    \??\\\MyDFSServ\User

    This below works great but i need to do this with the network using the subst not the Net Send as it will create the drive letter but not show the drive letter in my voice editing software. However, the subst method drive letter will show up in my software virtual drive list.
    \??\c:\\windows

      • Hi Helder,

        Thanks for the reply, howvere, i was refering to Not use the Net Use way but with the subst.exe

        The reason being is that the Panasonic Voice Editor Software will not recognize the net use created drive letters in its Drive list when browsing – however, it recognizes subst drive letters and includes them in its browser list.

        the permenant drive letter mapping via the above article works for local mappings but not network mappings via subst.exe

        At this time the only method i could get it to work, was to map the network path via net use and then use the permenant subst drive method to map another drive letter to the new net use created drive letter

        My questions was how to eliminate the net use altogether and only use the subst.exe to map 1 drive letter to the network path.

        I hope this is understandable lol

        Thanks again,
        you Rock!!!

        Sincerely,
        Z

  2. Thank the GODS!! Well… you!! I have spent hours playing with settings and restores and more… when my drive swapping (and playing) ended up with boot drive as D:\. Couldn’t install programs easily to sort out some temporary stuff… the drive subst worked a charm!!!!

    Cheers.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s