Create Soft and Hard Symbolic Links in Windows

Open Command Line with administrative rights

To create a symbolic link, we need to enter the following in command prompt:

MKLINK [[/D] | [/H] | [/J]] Link Target

/D Creates a directory symbolic link. Default is a file symbolic link.
/H Creates a hard link instead of a symbolic link.
/J Creates a Directory Junction.
Link specifies the new symbolic link name.
Target specifies the path (relative or absolute) that the new link refers to.

Soft|Symbolic Link to Directory

mklink /D "x:pathtoLink" "x:pathtotarget"

Hard Link to Directory

mklink /J "x:pathtoLink" "x:pathtotarget"

Soft|Symbolic Link to File

mklink "x:pathtoLinkfile" "x:pathtotargetfile"

Hard Link to File

mklink /H "x:pathtoLinkfile" "x:pathtotargetfile"
%d bloggers like this: