How do I map OneDrive with another drive?
The OneDrive for Business folder naming convention is OneDrive - {CompanyName}
. Most applications can cope with this naming when storing data on a local drive. In a previous blogpost I showed how you can map a symlink path to an OneDrive folder to fool incompatible applications to write to your OneDrive.
I came across another use case where we had to ensure that a specific drive letter is mapped to an OneDrive folder. I came across this solution where you can map a drive letter with a folder.
This script takes two parameters. One is the folder name you want to create on your OneDrive. The second parameter is the drive name which will be mapped to that folder.
Please note that mapping the drive is not permanent. If you want to have this applied on every restart you have to ensure that you run subst to run on startup. You should consider creating an entry under HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Run with your command. You can find more information here.
I came with this last version which is written in PowerShell and creates the necessary startup script to map the folder on each startup.