Create Virtual Drive From A Folder in Windows 10

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.Windows 10 Subst Mount Folder To Drive
  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.

Windows 10 Subst Virtual Drive Windows 10 Subst Virtual Drive Contents

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.Windows 10 Subst Virtual Drives Available

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.Windows 10 Subst Remove Virtual Drive
  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.Windows 10 Subst Create Batch File
  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.Windows 10 Subst On Startup

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.

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

  1. Andrew

    MS-DOS живее всех живых

    Reply
  2. Rick Grunwald

    This is good stuff! I had forgotten about this. I used to do it with MS DOS

    Reply
    1. Sergey Tkachenko Post author

      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.

      Reply
  3. Grzegorz

    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\””

    Reply
  4. Slava

    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.

    Reply
  5. SHARON M KELLY

    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!

    Reply

Leave a Reply

Your email address will not be published. Required fields are marked *