If your employer or university provides you with Microsoft OneDrive, you’ll know how useful it can be. But the OneDrive folder name tends to be very, very long, like “OneDrive - The University of Quahog”. The long name can get in the way, for example when in the prompt of an IDE, in a terminal session or when browsing files in Explorer. One simple command,
mklink, can fix that.
It is possible to rename the OneDrive folder, but the renaming method is very hacky, high risk and involves numerous changes within the Windows registry. It is not recommended.
An alternative is to keep the long folder name unchanged and to simply avoid using it by creating a symbolic link (“symlink”, for short) to it and using the symlink instead. The specific type of symlink being used here is a Junction Point .
The symlink looks and behaves similar to a folder. You can give it a simple & short name, for example, “uni”.
For example, the paths below point to the same location:
1C:\Users\fred\OneDrive - The University of Quahog\... 2 3C:\Users\fred\uni\...
In the example above, the OneDrive folder called “OneDrive - The University of Quahog” exists, it remains unaffected and can continue to be used as normal. Also, the much short folder, “uni”, can be used in place of the long OnrDrive folder.
Firstly, make a note of the following 3 things:
- The long name of the OneDrive folder, for example “OneDrive - The University of Quahog”.
- The parent folder of the OneDrive folder - hint, the parent folder is usually the user folder of the current Windows user, for example, “C:\Users\fred”.
- The name of the symlink you want to use, for example something short like, “uni”.
- open a CMD prompt, so press Windows and type
cmd, click on the top search result (Command Prompt App)
- navigate to the parent folder you noted above and create your new symlink with a short name, using the
mklinkcommand with the
/Jparameter, for example:
1mklink /J uni "OneDrive - The University of Quahog"
You’re done, you can now close the cmd terminal and use uni, or whatever name you created, as an alternative folder to your long OneDrive folder.
Tip: add it to you Quick access shortcuts in Explorer, so in Explorer navigate to your new folder, for example, C: > Users > fred > uni, right-click on uni and select “Pin to Quick access”.
- open a PowerShell prompt, enter the following command, remembering to use the 3 values you noted above:
1New-Item -ItemType Junction -Path 'C:\Users\fred\' -Name 'uni' -Target 'C:\Users\fred\OneDrive - The University of Quahog'