Softlink / Symbolic link in Windows NTFS

Softlinks are useful in any operating system to shorten long, complicated path names like C:/user/foo/data to just C:/data. You may need to add user permission to create symbolic links.

Windows Command Prom

mklink LINK TARGET

For directories add the /d option

mklink /d LINK TARGET

Example

The default GNU Make filename in MinGW is mingw32-make.exe, but we’d rather type make:

cd C:\mingw\mingw64\bin

mklink make.exe mingw32-make.exe

Powershell

Powershell’s symbolic link creation syntax is more verbose:

New-Item -ItemType SymbolicLink -Path "Link" -Target "Target"

Example

cd C:\mingw\mingw64\bin

New-Item -ItemType SymbolicLink -Path "make.exe " -Target "mingw32-make.exe"

Notes

ln -s /media/myusbdrive/data ~/data

Notice that the order of target arguments are reversed between Windows and Linux.