Skip to content →

HOWTO: Map a Folder to a Drive Letter

Typically, you may map a network share to a drive letter on your machine for easy access. It usually comes in handy, but wouldn’t it be nice to do it on any folder, rather than just a network folder? You can actually do it with the subst command.

Use the following command in the command prompt:

subst letter: c:\folder\path

Replace “letter:” with an available drive letter. Here’s an example of mapping my music folder to the M:\ drive:

subst m: C:\Users\Mark\Music

Now, if you want to remove the drive letter mapping, issue the following command on the drive letter:

subst letter: /d

For example, to remove the mapping for my M:\ drive, I would do:

subst m: /d

Published in time savers windows

3 Comments

  1. mtndew mtndew

    How do you make this permanent? So it maps when you reboot?

  2. John John

    Sure. Create a new text file in Notepad.

    Name it map.bat (or something.bat) and insert the line:

    subst m: C:\Users\username\Music

    Press the Enter key to start a new line. Add any other mapped drives you wish on separate lines.

    Save the file, click yes to replace it if you already created it and are editing.

    If you put that file into your startup folder the mapping would be available under your account whenever you startup.

  3. John John

    After a few moments thought it occurred to me that the .bat file for XP or Vista might have to call cmd first in order for the command to execute.

    For a GUI OS like XP or Vista, you’d probably be better off to set up a shortcut on your desktop.
    Right click with the mouse on an empty spot on your screen and select “New” then “Shortcut”. Either type in the folder pathname or click on Browse and select it. Follow the prompts to complete the shortcut.

Comments are closed.