Mounting OneDrive as a Letter Drive (Windows)

This article will show you how to mount your OneDrive as a letter drive. The subst command allows you to map a local folder, such as your OneDrive folder, to a drive letter. Follow these steps to mount OneDrive as a letter drive using Command Prompt.

Prerequisites

Ensure you’re logged in to OneDrive on your Windows machine and that your OneDrive files are syncing.

Mounting OneDrive

Locate Your OneDrive Folder Path

  • Open File Explorer.
    • Navigate to your OneDrive folder. Copy this full path for use in the next step. By default, it’s usually located at:

C:\Users\YourUsername\OneDrive - Grand Valley State University

Open Command Prompt

  • Click on the Start menu, type cmd, and then click on Command Prompt.

Use the subst Command

  • In the Command Prompt window, enter the following command, replacing X: with your desired drive letter and C:\Users\YourUsername\OneDrive with the path to your OneDrive folder

subst X: "C:\Users\YourUsername\OneDrive - Grand Valley State University"

  • Press Enter. This command assigns the selected drive letter to your OneDrive folder, effectively "mounting" it.

subst O: "C:\Users\JohnDoe\OneDrive - Grand Valley State University"

Access Your OneDrive as a Letter Drive

  • Open File Explorer and navigate to This PC. You should now see your OneDrive folder accessible as the drive letter you chose (e.g., O:).

Making the Drive Mapping Persistent

The subst command’s mappings aren’t permanent and will disappear when you restart your computer. To make it persistent, you can create a startup script:

Create a Batch File

  • Open Notepad and type the subst command:
subst X: "C:\Users\YourUsername\OneDrive"
  • Save this file as MapOneDrive.bat.

Add to Startup

Press Win + R, type shell:startup, and press Enter. This opens the Startup folder.

Place your MapOneDrive.bat file in the Startup folder. This script will now run every time you log into Windows, reapplying the drive mapping.

Was this helpful?
0 reviews