Create Virtual Drive From A Folder in Windows 10

Hdd Disk Ssd Hard Drive Icon Big 1

How to Create Virtual Drive From A Folder in Windows 10

A lesser known feature of Windows 10 is the ability to create a virtual drive from a folder. This will add a new hard drive to the This PC folder, with a dedicated drive letter. Opening the drive in File Explorer will display the contents of the source folder located in the root folder of the drive.

This can be done with help of the built-in subst command. It associates a path with a drive letter. If used without parameters, subst displays the names of the eixsting virtual drives you have already created with the tool.

The subst tool is not an exclusive feature of Windows 10. It was first introduced in DOS, and is included in every Windows version.

Drives that were created using subst remain available during your user session, or until you unmount a virtual drive manually. Restarting, shutting down the PC or signing out from your user account will destroy virtual drives, and you will need to re-create them to use them again.

To Create Virtual Drive From A Folder in Windows 10,

  1. Open a new command prompt instance.
  2. Type the following command: subst <drive:> path\to\folder.
  3. Replace the <drive:> portion with the actual drive letter you want to assign to the virtual drive. The letter shouldn't be used by any real or virtual drive, inlcuding removable devices currently plugged in.
  4. Substitute the path\to\folder portion with the full path to the source folder you want to mount as a drive.
  5. Hit the Enter key. The drive is created.

Now, open File Explorer and check out the This PC folder. You will see a new drive there.

With subst, you can quickly find virtual drives you have available in the current user session.

Find Virtual Drives Created with Subst

  1. Open a new command prompt.
  2. Type subst without parameters and hit the Enter key.
  3. In the output, you will see the list of virtual drives created with subst.

You are done.

Finally, let's see how to remove a drive created with subst.

Remove Virtual Drive Created with Subst

  1. Open a new command prompt.
  2. Type the following command: subst <drive:> /D.
  3. Replace the <drive:> portion with the actual letter for the virtual drive you want to remove.
  4. Hit the Enter key. The drive is now removed.

You are done.

Tip: You can make Windows 10 mount a folder to a virtual drive every time you sign in to your user account. This can be useful if you have a software that looks for files under some hardcoded location, that is not available on your PC. Here's how.

Create a Virtual Drive with Subst On Startup in Windows 10

  1. Create a new batch file with the following contents:
    @subst W: c:\Data\drive_w
    Correct the drive letter and the folder path to match your requirements.
  2. Press Win + R to open the Run dialog.
  3. Type the following shell commandshell:Startup.
  4. This will open the Startup folder. Move your batch file there.

You are done! Every time you sign in Windows 10 will create a virtual drive from the specified folder and assign it the appropriate drive letter.

That's it.

Support us

Winaero greatly relies on your support. You can help the site keep bringing you interesting and useful content and software by using these options:

If you like this article, please share it using the buttons below. It won't take a lot from you, but it will help us grow. Thanks for your support!

Author: Sergey Tkachenko

Sergey Tkachenko is a software developer who started Winaero back in 2011. On this blog, Sergey is writing about everything connected to Microsoft, Windows and popular software. Follow him on Telegram, Twitter, and YouTube.

11 thoughts on “Create Virtual Drive From A Folder in Windows 10”

    1. Yep! Last OS in which I used it was Windows 98 :-) There was some app which was looking for files on non-existing drive, so I made a drive with subst.

  1. This registry modification add context menu to folder to mount virtual drive as R drive :)

    Windows Registry Editor Version 5.00
    [HKEY_CLASSES_ROOT\Directory\shell\Mount R\command]
    @=”subst r: \”%1\””

  2. Pay attention about one stone under water:
    This is works for current user only.
    So, if any app will require admin rights, then… this app, after startup, will have no mounted disks in their environment.

  3. Please relist your Windows 7, 8.0, 8.1, 10 older games files so they are easier to locate on your website. I prefer these to the new Windows 10 Microsoft Games Collection. I have downloaded them in the past from your website, but today I was unable to locate these older files you previously had listed. Your work is greatly appreciated by all of us who are not techno-geeks. May I suggest that you add a tab to the top links of webpage that says “Previous Programs” or something to akin to “Older Software” to be able to locate this easier Sergey Tkachenko! We really miss these programs. Thanks for all you do for the community too!!
    Big Hugs >> Sergey Tkachenko!

  4. I’m trying to use subst command in Windows 10 Pro build 19044 but it doesn’t seem to do anything. Maybe it got disabled? I’ve tried admind command prompt, restarting etc.

Leave a Reply

Your email address will not be published.

Exit mobile version
Using Telegram? Subscribe to the blog channel!
Hello. Add your message here.