How To Mount a folder as Virtual Drive in Windows 10

If you are using a folder frequently in your system, one way to access it quickly is by creating a virtual drive for that folder in the system. By doing so, you can easily navigate to that folder using the explorer, RUN command, or command prompt. This will save a good amount of time.

In this article, we will be discussing How to create or Mount any Folder as a Virtual drive in Windows 10. Also, let us see how to view all the existing virtual drives in the system, delete virtual drives, and also mount a folder as a virtual drive at the StartUp. All of this can be achieved with a built-in utility called subst

Important Points to be known before proceeding:

  • When a folder is mounted as a virtual drive, you will be able to access the contents of it from the virtual drive. Any modifications that are made to the files or folders within it will be saved in the actual location. That is, the folder is mounted as a virtual drive but physically, the location is still the actual folder location.
  • By default, The Virtual Drives that are created are available only for the current user session. They will be removed automatically when you Log out, Restart or Shut down the PC.
  • Use of commands such as diskcomp, diskcopy, recover, format, label, and chkdsk will not work on these drives and might even cause problems for the physical drives.

 

Viewing the existing virtual drives in the system

Step 1: Open the Run Dialog using the shortcut Win Key +R

Step 2: Enter cmd and hit Enter

 

 

Cmd



 

 

Step 3: In the command prompt window that opens, type the below command and hit the Enter key

subst

 

The list of virtual drives for the current user session will be displayed.

 

Listofdrivesincmd

 

 

In the above example,is the name of the virtual drive and the C:\Anusha\Geekpage is the actual location of the folder.

Creating / Mounting a folder as a Virtual Drive

Step 1: Open Command prompt(Refer steps 1,2 from Fix 1)

Step 2: In order to create a folder as a Virtual drive, enter the below command and hit Enter

subst <Virtual Drive Name>: <Path to the Folder>

 

NOTE:

  • Virtual Drive Name – The Virtual Drive Name should be a single letter. Like C, D, E, F, etc. The drive letter that is already in use cannot be specified. Like if we have two drives i.e C and D in the system already, then you cannot use C and D for creating virtual drives
  • Path to the folder – Specify the full path to the folder. In case, the path to the folder contains spaces, then the Path must be enclosed within double-quotes.

 

Let us consider two examples to understand the command better.

Let us say we want to create a virtual drive named I for the folder location C:\Anusha\Geekpage, then we can issue the below command

subst I: C:\Anusha\Geekpage

 

 

Subst Create Command

 

 

Step 3: You can verify the creation of virtual drives by opening Explorer (Windows+E) Click on This PC at the left-hand side

 

 

Verify Virtual Drive Creation Min (1)

 

 

 

Let us say we want to create a virtual drive named J for the folder location C:\Anusha\The Geek Page, then we can issue the below command

subst J: "C:\Anusha\The Geek Page"

 

NOTE: In the above example, since there are spaces in the path, we enclose it within double-quotes.

 

Deleting the Virtual Drive for the Mounted Folder

By default, when you log out, Restart, or Shutdown the PC, the Virtual Driver will be deleted. However, if you want to delete it manually, do the following

Step 1: Open Command prompt(Refer steps 1,2 from Fix 1)

Step 2: In order to delete a folder mounted as a Virtual drive, enter the below command and hit Enter

subst <Virtual Drive Name>: /d

 

For Example, let us say if we want to delete the I virtual drive that we created earlier, issue the below command,

subst I: /d

 

Delete Subst Command

 

 

Mounting a folder as Virtual Drive at the StartUp

As we know, by default, when you log out, Restart, or Shutdown the PC, the Virtual Driver will be deleted. However, if you want the folder to be mounted as a virtual drive always, then you have to follow this method.

Step 1: Open Notepad

Step 2: Copy-paste the below commands

@echo off
subst <Virtual Drive Name>: <Path to the Folder>

 

NOTE:

  • Virtual Drive Name – The Virtual Drive Name should be a single letter. Like C, D, E, F, etc. The drive letter that is already in use cannot be specified. Like if we have two drives i.e C and D in the system already, then you cannot use C and D for creating virtual dries
  • Path to the folder – Specify the full path to the system. In case, the path to the folder contains spaces, then the Path must be enclosed within double-quotes.

 

Let us say we want to create a virtual drive folder named I for the location C:\Anusha\Geekpage, then we can issue the below command

@echo off
subst I: C:\Anusha\Geekpage

 

 

Commands In Notepad

 

 



Step 3: Press Ctrl+S  to save the file. The Save As window appears.

Step 4: In the address bar specify the location where this file has to be saved. Example, Desktop

Step 5: Give the file a suitable name. The extension should be .bat

For example, if you want to name the file as I-GeekPage, under the File name section type, I-GeekPage.bat

Step 6: From the Save as type drop-down, choose All Files(*.*) 

Step 7: Click on the Save button

 

Save Bat File Min Min

 

 

Step 8: Copy this bat file and save a copy of this in the StartUp Folder

 



NOTE:

  • You will need Admin rights to save the file in the Startup Folder
  • Startup folder location for the user:
C:\Users\%username%\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

 

  • Startup folder location for all the Users
C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

 

That’s All. We hope this has been informative. Thank you for Reading