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

Today we are going to tell you about a secret DOS command "subst" which can be used to create a virtual drive in Windows Explorer for any of your desired folder.

For example, if you frequently use a folder "E:\Wallpapers", then you can create a virtual drive in Explorer which will directly go to this folder whenever you 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


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

Before using subst command:


After using subst command:


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


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


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. If your folder path contains spaces, put the whole path in double-quotes ("").

C. 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.

Also check:

[AIO] Ultimate Tutorial to Customize My Computer Context Menu in Windows

Share this article: Facebook | Twitter | Google+ | Reddit | Tell a friend

Posted in: Windows 7, Windows Vista, Windows XP

Other similar articles that may interest you


  • Nice one but easier to use apps like vsubst or visual subst which do the same but with no hassle )

  • It is giving me the following error:
    Incorrect number of parameters - Menu\coolking
    when I Typed :
    C:\Users\Soni Srivastava>subst v: c:\C:\ProgramData\Microsoft\Windows\Start Menu\coolking

    Please help.
    thanks in advance.

  • VG

    ^^ There are 2 C:\ in your command:

    C:\Users\Soni Srivastava>subst v: c:\C:\ProgramData\Microsoft\Windows\Start Menu\coolking

    Also enclose the folder path between double-quotes as your folder name contains spaces. The correct command would be:

    C:\Users\Soni Srivastava>subst v: "C:\ProgramData\Microsoft\Windows\Start Menu\coolking"

  • Nice on VG!, but it gets all the characteristics from the parent Drive.

  • There's inconsistencies between your code above on the "How To" and the answer you provided to Cool King.

    The text shows: "E:\Wallpapers"
    But the image does not.

    You should recapture that image to show the quotations or it wont work at all and give him the error, Incorrect number of parameters.

    Good assistance though.

  • Thanks for a very clear description of virtual drive creation. I have 7 Pro as Host, and XP as Guest. When I insert the following text into Command Prompt it works fine and sets up the S Virtual Drive: subst S: C:\MySharedFolder (spaces after subst and S:). However, when I shut down and restart the Host 7 Pro the Virtual Drive S no longer exists. I thought the answer was to start Command Prompt as Administrator, however instead of the usual C:\Users\PC> to be followed by my above text, of course I get C:\Windows\system32 and I don't know the correct text to set up a Virtual Drive as Administrator...if it's possible or if it would work anyway.
    All I really want to do is to keep the Virtual Drive on my 7 Host PC following shut down.
    Thanks, Regards, Mike

  • Further to the above, I set up the subst,( not as admin), to create the Virtual Drive. Then as Administrator I just put C:\Windows\system32>subst This gave me the correct path as
    C:\Windows\system32>subst S:\: => C:\MySharedFolder. This is presumably correct as I get
    "Access Denied".................! Now what?

  • Fixed Access Denied via UAC, set up Virtual Drive as Administrator, still disapears on restart.

  • Mike, please see You need to modify registry in order to keep drive after reboot

Leave a Comment