3/19/2006

Tip: Map Drive Letter To Local Folder With SUBST

Filed under: — By Aviran Mordo @ 9:59 pm

With the increase of disk space we tend to store more files on the hard drives. Managing these files is done using folders, sub folders and more nested folders. Accessing these nested folders is an irritating task, especially if you have a multi level nested folder that you access frequently.

Other ways to reduce the clutter is to partition the drives to a more manageable size. But this is not always possible. So what to you do when you need to access a nested folder frequently? Well here is a nice little trick that exists from the old DOS days, but was forgotten.

You can easily map a local folder to a virtual drive letter, thus by “switching? drives you are simply redirected to that folder.

In order to map a local folder to a drive letter follow these steps:

  • Go To Start->Run, type Cmd and press Enter.
  • Now type the following command in the command prompt: subst drive: path_to_folder and Enter.

For example lets say we want to map the My Documents folder to drive letter M: so we type: subst M: C:\”Documents and Settings\YourUserName\My Documents”

Now every time you’ll enter M: you will be redirected to the My Documents folder. Also this new virtual drive will show in Windows File Explorer.

To delete a mapping you simply type SUBST drive1: /D – so in our example, if we want to delete the mapping of M: to My Documents we simply type SUBST M: /D.

Typing SUBST without any parameters will display all the mappings.

 

4 Responses to “Tip: Map Drive Letter To Local Folder With SUBST”

  1. Mark Says:

    Only thing is that this is not quite right. The quotes in the example should start before the C. Also, the drive is visible for me only under the DOS prompt, not in Windows Explorer (and I restarted Windows Explorer to make sure).

    So, not as useful as I hoped. I guess the mapped drive could be used in .bat files or other types of scripts that can access the DOS command line.

  2. Mark Says:

    Please ignore my first comment. Apparently I shouldn’t have had the chorizo sausage in that breakfast burrito this morning.

  3. Bharat Mori Says:

    Thanks for descriptive and good explanation.
    It made my work easy.
    Thanks a lot.

  4. Thangaraj Says:

    Execellent work sir, Thanks it really helped me :)

Leave a Reply

You must have Javascript enabled in order to submit comments.

All fields are optional (except comment).
Some comments may be held for moderation (depends on spam filter) and not show up immediately.
Links will automatically get rel="nofollow" attribute to deter spammers.

Powered by WordPress