Showing posts with label mklink. Show all posts
Showing posts with label mklink. Show all posts

Sunday, September 10, 2017

The Complete Guide to Creating Symbolic Links | How to create a Symbolic Link on Windows

mklink creates a symbolic link to a file. The below command creates a symbolic, or “soft”, link at Link pointing to the file Target :

mklink "c:\tmp\a.txt" "c:\tmp\b.txt"

will create link a.txt (destination) that is equal to b.txt (source)

Use /D to create soft link pointing to a directory. like so:

mklink /D "c:\tmp\dir_destination" "c:\tmp\dir_source"

Use /H to create hard link pointing to a file:

mklink /H "c:\tmp\dir_destination" "c:\tmp\dir_source"

Use /J to create hard link pointing to a directory, also known as a directory junction:


mklink /J "c:\tmp\dir_destination" "c:\tmp\dir_source"

mklink /J Link Target

And below command will remove symbolic link on a drive:

rmdir "c:\tmp\dir_destination"