Symbolic links in Windows

Windows Vista and 7, if not before, allow symbolic links — mklink is your command-line friend!

Creates a symbolic link.

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.

So finally you can now do virtual linking from file one to file two – and Windows will respond correctly!!

mklink D:\documents \\192.168.1.1\documents would create a softlink to the path on the network as a physical directory. Convert it to a hardlink by using /J – if you use /H you’d be creating a hardlink to a file specifically.

In the world of the bash you’d use ln -s for your softlink, of course. But you knew that already! 🙂

Leave a Reply

Your email address will not be published. Required fields are marked *