Map a OneDrive Folder to a Drive Letter Using SUBST

Map a OneDrive Folder to a Drive Letter Using SUBST

Overview


This guide explains how to map a specific OneDrive subfolder to a drive letter in Windows using the built-in SUBST command.


This method creates a virtual drive letter that points to a folder on your local system, including a synced OneDrive directory.



Important Notes


- This method works only if the OneDrive folder is fully synced locally.


- The mapped drive will disappear after a reboot unless additional steps are taken to make it persistent.


- Administrative rights are not typically required.



Step-by-Step Instructions



Step 1 - Ensure OneDrive Is Synced


1. Confirm that OneDrive is running.


2. Verify the folder you want to map is available locally and not cloud-only.


3. Note the full local path of the folder.


Example:


C:\Users\YourUserName\OneDrive\CompanyName\SubFolder



Step 2 - Open Command Prompt


1. Press the Windows key.


2. Type cmd.


3. Open Command Prompt.



Step 3 - Navigate to the Folder


Use the cd command to change to the directory you want to map.


Example:


cd "C:\Users\YourUserName\OneDrive\CompanyName\SubFolder"



Step 4 - Create the Drive Letter Mapping


Run the following command:


subst H: .


Important:


- There is a space after H:.


- The dot represents the current directory.


This maps the current folder to drive letter H:.



Verify the Mapping


1. Open File Explorer.


2. Select This PC.


3. You should now see drive H: listed.


Opening H: will take you directly to that OneDrive subfolder.



How to Remove the Mapping


If you need to remove the mapped drive, run:


subst H: /d


This will delete the virtual drive.



Making the Mapping Persistent (Optional)


By default, the SUBST mapping disappears after reboot.


To make it persistent:


1. Press Windows Key + R.


2. Type:


shell:startup


3. Create a new text file.


4. Add this line:


subst H: "C:\Full\Path\To\Folder"


5. Save the file as:


mapdrive.bat


Now the drive will remap automatically when the user logs in.



When to Use This Method


This is useful when:


- An application requires a drive letter instead of a UNC path.


- Legacy software does not work well with long OneDrive paths.


- You want easier navigation to a deep folder structure.

    • Popular Articles

    • How to add your Microsoft 365 Email on an iPhone using the Outlook app

      How to Set Up Microsoft 365 Email on Your iPhone Using Outlook This guide will walk you through downloading the Outlook app and adding your Microsoft 365 email account on your iPhone. ————— Step 1: Download the Outlook App 1. Open the App Store on ...
    • Outlook Error "5objp" when setting up email on Outlook App

      Follow these steps if you are having trouble signing into Outlook with your Microsoft 365 account: ————— Step 1: Start with the onmicrosoft.com Address • First, try signing in using the @myorg.onmicrosoft.com format email address. – Example: ...
    • How to update your credit card on file

      Do you need to update your credit card on file within the Twilight I.T. Customer Portal? Here is what you need to do... Step 1: Log into the portal at https://portal.twilightit.com Step 2: Click on BILLING in the top menu. Step 3: Click on PAYMENT ...
    • How to view or download invoices on your account

      Here is the process of viewing and/or downloading invoices on your account with Twilight I.T. Step 1: Log into the client portal at https://portal.twilightit.com Step 2: Click on the BILLING menu Step 3: From here you can view all your invoices. If ...
    • How to add your Microsoft 365 Email on an Android phone using the Outlook app

      How to Set Up Microsoft 365 Email on Your Android Phone Using Outlook This guide will walk you through downloading the Outlook app and adding your Microsoft 365 email account on your Android device. ————— Step 1: Download the Outlook App 1. Open the ...