Create a symbolic link with mklink on Windows
mklink and mklink /D examples to point a short path to a OneDrive folder or an external drive.
The Windows mklink command creates symbolic links. For example, it can expose a synced folder (OneDrive, external drive) under a short path.
Symbolic link to a folder
mklink /D "c:\Dev" "C:\Users\username\OneDrive - Contoso\Dev"
The first path is the link being created, the second is the target. The /D option is required for a folder link; without it, mklink creates a file symbolic link.
mklink "c:\Dev" "C:\Users\username\OneDrive - Contoso\Dev"
Link to an external drive
mklink "c:\mnt\usb_storage" "F:\rclone_data"
Notes
- Run
mklinkfromcmd(it is a built-incmdcommand, not an executable). - The link path must not already exist.