Create a Virtual Drive for Your Desired Folder in My Computer Using Subst Command



Today I'm going to tell you about a secret DOS command "subst" which can be used to create a virtual drive letter for any of your desired folder in My Computer window.

For example, if you frequently use a folder named "Wallpapers" which is situated in E:\Data\Gallery\Wallpapers", then you can create a virtual drive say "H:" in My Computer which will goto this folder directly whenever you'll double click on it or access it from RUN or Command Prompt. It'll save a lot of time.

Here is how to do it:

1. Open Command Prompt and provide following command:

subst drive_letter: folder_path

for example, if you want to create a virtual drive letter H: for a folder "E:\Wallpapers", then use following command:

subst H: E:\Wallpapers

http://img.photobucket.com/albums/v374/vishaal_here/Creating_Virtual_Drive_using_subst_.jpg

2. It'll immediately create a virtual drive H: which will represent the "Wallpapers" folder:

Before using subst command:

http://img.photobucket.com/albums/v374/vishaal_here/Default_Drives_in_My_Computer.jpg

After using subst command:

http://img.photobucket.com/albums/v374/vishaal_here/Virtual_Drive_in_My_Computer.jpg

3. As you can see. A new drive letter H: has been created which directly goes to "E:\Wallpapers" folder upon double-click.

4. If you want to delete this virtual drive, then provide following command:

subst drive_letter: /D

for example, we created H: drive in Step1, so our command to delete this virtual drive would be:

subst H: /D

http://img.photobucket.com/albums/v374/vishaal_here/Deleting_Virtual_Drive_using_subst_.jpg

5. You can view a list of all existing virtual drives by simply giving subst command without any parameter in Command Prompt.

NOTE:

A. Remember! You can't use existing drive letters for creating virtual drives, e.g. if you have 2 partitions C: and D:, then you can't use them for subst command.

B. You should not use chkdsk, diskcomp, diskcopy, format, label and recover commands on virtual drives created using subst command as these virtual drives are not real and these commands either will not work or can cause problems for the actual drives where the folders reside.

Complete list of AskVG articles



This article was posted in Windows 7, Windows Vista, Windows XP.


Share |


Related Articles

Popular Articles



25 Comments

  • VG

    ^^ Its "AeroVG" theme for Windows Vista. You can get it in "Vista Themes" section.

  • IT DOES NOT WORK...

  • VG

    ^^ It works. Make sure you are logged in as Administrator. Otherwise run Command Prompt as Administrator.

  • Vishal, it worked for me in Windows XP Pro, and i am limited account.
    So if this trick goes away next time i reboot my pc, then i just create
    .bat file that contains all that code what i want and my pc shows again
    that drive. :)

  • nice one.. :wink:

  • if you want the drive letter to be there all the time u have to go in to :
    start>all programs>accessories>system tools>scheduled tasks.Create and new task and browse for the batch file u created.Set it up to run on log in.that should do the trick
    Thanks.........

  • how do i rename the local disk???

  • I have created a virtual drive on my windows xp and now i cant delete it. anyone know how?

  • Can we boot from a virtual disk :?: If Yes, then how :?:

  • VG

    ^^ I don't think we can boot from this virtual drive.

Add a Comment

NOTE: If you can't see your comment, please be patient. It'll appear as soon as we approve it.


Create an avatar that will appear with your comment.