Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10  

    Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10

    Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10

    How to Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10
    Published by Category: Virtualization
    20 Oct 2019
    Designer Media Ltd


    How to Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10


    In Windows, you can mount any folder at any location as a virtual drive with a drive letter.

    When you mount a folder as virtual drive, you will be able to access the folder from the virtual drive. The contents of the folder will still physically be located in the folder. Anything you save into the virtual drive will actually be saved to the folder's location.

    Virtual drives from mounted folders are not persistent and only available during the current user session by default. If you sign out, restart the computer, or shut down the computer, all current virtual drives will be removed (unmounted).

    See also:

    This tutorial will show you how to mount any folder as a virtual drive with a drive letter in Windows 7, Windows 8, and Windows 10.


    Contents



    EXAMPLE: Folder mounted as virtual drive in Windows 10 File Explorer > This PC
    Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10-folder_mounted_as_virtual_drive.png






    OPTION ONE

    See All Current Virtual Drives for Mounted Folders


    1 Open a command prompt.

    2 Type subst into the command prompt, and press Enter. (see screenshot below)

    3 You will now see a list of all current virtual drives.

    Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10-subst.png






    OPTION TWO

    Mount Folder as Virtual Drive


    1 Open a command prompt.

    2 Type the command below into the command prompt, and press Enter. (see screenshot below)

    subst <virtual drive letter>: "Full path of folder"

    Substitute <virtual drive letter> in the command above with a currently unused drive letter (ex: "G") you want to be assigned to the virtual drive.

    Substitute Full path of folder in the command above with the actual full path of the folder (ex: "C:\Users\Brink\Desktop\Any Folder") you want to be mounted as a virtual drive.

    For example: subst G: "C:\Users\Brink\Desktop\Any Folder"

    Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10-mount_subst.png

    3 If you like, you can rename the virtual drive to what you want.

    The virtual drive will have the same name as the source drive/volume of the folder by default.

    If the source drive/volume of the folder has been renamed, then the virtual drive cannot be renamed.

    If you rename the virtual drive, this name will be persistent each time you mount the same folder path using the same drive letter.


    4 You can close the command prompt if you like.






    OPTION THREE

    Remove Virtual Drive for Mounted Folder


    This option can be handy when you want to remove a virtual drive for a mounted folder without having to sign out, restart the computer, or shut down the computer.


    1 Open a command prompt.

    2 Type the command below into the command prompt, and press Enter. (see screenshot below)

    subst <virtual drive letter>: /d

    Substitute <virtual drive letter> in the command above with the drive letter (ex: "G") of a virtual drive you want to remove.

    3 You can close the command prompt if you like.

    Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10-unmount_subst.png






    OPTION FOUR

    To Always Mount Folder as Virtual Drive at Startup


    This option allows the folder to always be mounted as a virtual drive even after you sign out, restart the computer, or shut down the computer.


    1 Open Notepad.

    2 Type the commands below into Notepad. (see screenshot below)

    @echo off
    subst <virtual drive letter>: "Full path of folder"


    Substitute <virtual drive letter> in the command above with a currently unused drive letter (ex: "G") you want to be assigned to the virtual drive.

    Substitute Full path of folder in the command above with the actual full path of the folder (ex: "C:\Users\Brink\Desktop\Any Folder") you want to be mounted as a virtual drive.

    For example:
    @echo off
    subst G: "C:\Users\Brink\Desktop\Any Folder"

    Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10-create_bat_file-1.png

    3 In Notepad, press the Ctrl + S keys OR click/tap on File (menu bar) and click/tap on Save to save this as a batch (.bat) file. (see screenshot below)

    Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10-create_bat_file-2.png

    4 Perform the following actions in the Save As dialog: (see screenshot below)

    1) Navigate to where (ex: "Desktop") you want to save the .bat file.

    2) Select All Files (*.*) in the Save as type drop menu.

    3) Type a name you want for this batch file along with the .bat file extension.

    It is recommended to name the .bat file something to let you know which folder it is mounting as a virtual drive. For example: G-Any Folder.bat

    4) Click/tap on Save.

    Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10-create_bat_file-3.png

    5 You can now close Notepad.

    6 Open File Explorer Win + E.

    7 Save a copy of the .bat file into the Startup folder(s) of the user(s) you want to always have the folder mounted as a virtual drive. (see screenshot below)

    You will need to be signed in as an administrator to save a copy of the .bat file into the Startup folder of another user or for all users.

    To undo this for a virtual drive, delete its .bat file in the Startup folder.

    Startup folder location for user:
    C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup

    Startup folder location for all users:
    C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup

    Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10-startup_folder.png

    8 You can now close File Explorer.


    That's it,
    Shawn



  1. Steve C's Avatar
    Posts : 6,295
    Windows 10 Pro 64 bit
       #1

    I'm the first to reply.

    I can mount my test folder which then has the same name as the original drive. Any attempt to rename the virtual drive is rejected as shown below. How can I rename the virtual folder?

    Attachment 316180
      My Computers

  2. Brink's Avatar
    Posts : 56,414
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #2

    Steve C said:
    I'm the first to reply.

    I can mount my test folder which then has the same name as the original drive. Any attempt to rename the virtual drive is rejected as shown below. How can I rename the virtual folder?
    Hello Steve,

    You should normally be able to rename the virtual drive like any other drive in This PC.

    That error message indicates you may possibly entering an invalid character??

    As a test, unmount the folder as a virtual drive, remount it, and see if you're able to rename the virtual drive.
      My Computers

  3. Steve C's Avatar
    Posts : 6,295
    Windows 10 Pro 64 bit
       #3

    I discovered the problem. If the original drive linked to has been changed from Local Disk which I had done, then the name of the virtual drive cannot be changed. I set the source drive Z: to have no name and now I can set the name of the virtual drive as shown. I don't like the way the virtual drive replicates the size of the linked drive.

    Attachment 316193
      My Computers

  4. Brink's Avatar
    Posts : 56,414
    64-bit Windows 10 Pro for Workstations build 21359
    Thread Starter
       #4

      My Computers


 

Tutorial Categories

Mount Folder as Virtual Drive in Windows 7, Windows 8, and Windows 10 Tutorial Index Network & Sharing Instalation and Upgrade Browsers and Email General Tips Gaming Customization Apps and Features Virtualization BSOD System Security User Accounts Hardware and Drivers Updates and Activation Backup and Restore Performance and Maintenance Mixed Reality Phone


  Related Discussions
Our Sites
Site Links
About Us
Windows 10 Forums is an independent web site and has not been authorized, sponsored, or otherwise approved by Microsoft Corporation. "Windows 10" and related materials are trademarks of Microsoft Corp.

Designer Media Ltd
All times are GMT -5. The time now is 12:41.
Find Us




Windows 10 Forums