It is possible to add a drive letter to OneDrive on Windows 11 and Windows 10, so it will appear as a drive in File Explorer. If you actively use the OneDrive cloud storage, we assume that you would like to see its icon not only in the Explorer navigation bar, but also in This PC. This is not difficult to implement.
Once you set up OneDrive, it automatically syncs your files and folders. OneDrive works in the background, no manual intervention required. In Windows 10 and Windows 11, OneDrive has very close integration with the OS. Once you are signed in with your Microsoft Account, it starts prompting you to use OneDrive cloud storage as a place to save files and documents by default. You can also create backup copies of your documents in OneDrive.
How to Add Drive Letter to OneDrive
There are two ways to add a drive letter to OneDrive. Firstly, you can use the net use
command with the drive letter and path to the local cloud storage folder. It will add OneDrive to the Network Locations section. The other option is to to use the subst command. Both methods have advantages and disadvantages.
Add Drive Letter to OneDrive with net use
- Open a new Windows Terminal or command prompt.
- Type the following command:
net use X: \\localhost\C$\users\username\OneDrive
. - Replace the
username
portion with the name of your user account. - The OneDrive now appears in This PC.
As you already understood, X is the letter assigned to the drive, and username in the path is the name of your Windows account.
To remove this drive latter, use the net use X: /D
command.
You must run the command with the privileges of a regular user, not an administrator, otherwise nothing will work. As a result of running the command, in the Network Locations category of This PC, you will see an icon for a network drive with the name OneDrive, the specified path and letter at the end.
The drive letter can be hidden and only be seen in the tooltip when you hover the mouse cursor over the drive, since in the line with the path can be be long and simply does not fit. So, the folder has been added, but its appearance, let’s say, is not very good.
It is possible to add the OneDrive directory not in the “Network location” category, but to all local disks. There is a subst command in Windows, designed to create and delete virtual disks, which we can use for that purpose.
Using the subst command
- Open a Windows Terminal or command prompt as a regular user.
- Now type the following command:
subst X: C:\users\username\OneDrive
. - Replace the drive letter and the ‘username’ text with the proper values.
- Press ↵ Enter to run the command.
After executing the command, you will see your OneDrive cloud folder as a regular volume with an assigned letter. The only thing you will need to get used to is the displayed size of the OneDrive virtual disk. It will always have the size identical to the size of the system partition.
The undo command for this method is
subst X: /D
It will remove the OneDrive drive letter from This PC.