Skip to Content

How to Create Virtual Drive from Any Folder in Windows?

What’s the Smartest Way to Map a Folder as a Virtual Drive for Seamless Access?

Mapping a folder as a virtual drive in Windows streamlines access and boosts productivity. Here’s a clear, actionable guide to achieve this, with options for both temporary and persistent virtual drives.

Solution 1: Temporarily Map a Folder as a Virtual Drive

Use the built-in subst command to assign a drive letter to any folder for the current session.

  1. Press Win + R, type cmd, and press Enter.
  2. Enter the command:
    subst X: C:\Path\To\Your\Folder

    Replace X: with an unused drive letter and C:\Path\To\Your\Folder with your folder’s full path.

  3. Open File Explorer and check under “This PC” for your new drive.

Notes: This virtual drive disappears after a restart or sign-out.

To remove the virtual drive, use:

subst X: /D

Solution 2: Create a Persistent Virtual Drive

Automate the mapping so your virtual drive is available after every reboot.

  1. Open Notepad.
  2. Type:
    @echo off
    subst X: "C:\Path\To\Your\Folder"
  3. Replace X: and the folder path as needed.
  4. Save the file with a .bat extension (e.g., mapdrive.bat).
  5. Place the .bat file in your Startup folder:
    • For your user: C:\Users\<username>\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup
    • For all users: C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Startup
  6. The virtual drive will now be mapped automatically at each login.

Solution 3: Map a Folder as a Network Drive

Share a folder over your network and map it as a drive for easy access from any device.

  1. Right-click the folder, select Properties, then go to the Sharing tab.
  2. Click Share, choose users, and confirm.
  3. Copy the network path provided.
  4. In File Explorer, click This PC, then Map network drive.
  5. Choose a drive letter and paste the network path.
  6. Click Finish to complete the mapping.

Mapping a folder as a virtual drive is a practical way to simplify file management and speed up daily tasks. Choose the approach that best fits your workflow and enjoy more efficient access to your important folders.