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 install Office Apps (365) to your Windows or Mac computer

      How to Download and Install Microsoft 365 Office Apps (Windows and Mac) This guide will walk you through downloading and installing the Microsoft 365 Office apps, including Word, Excel, PowerPoint, Outlook, and more. The steps are nearly the same for ...
    • How to Save and Share a Document in OneDrive from Word or Excel

      Follow these steps to save your document to OneDrive and share it with others directly from Word or Excel. ————— Step 1: Save to OneDrive 1. In Word or Excel, click File. 2. Select Save As. 3. Choose OneDrive – [Your Organization or Personal]. 4. ...
    • How to Collaborate on a Document in Real-Time with Others

      Microsoft 365 allows you to co-author documents with colleagues in Word, Excel, or PowerPoint. ————— Step 1: Save to OneDrive or SharePoint 1. Open your file in Word, Excel, or PowerPoint. 2. Click File > Save As and select OneDrive or SharePoint. ...
    • How to Recover Unsaved or Previous Versions of Office Files

      If you lose changes or accidentally close a document, you can often recover it using Office’s built-in recovery tools. ————— Step 1: Recover Unsaved Files 1. Open Word, Excel, or PowerPoint. 2. Go to File > Info > Manage Document (or Manage ...
    • How to Use Templates in Word, Excel, and PowerPoint

      Microsoft Office apps come with ready-to-use templates to save you time. ————— Step 1: Access Templates 1. Open Word, Excel, or PowerPoint. 2. From the start screen, you’ll see featured templates. 3. Or click File > New to browse available templates. ...