2009-04-27

Symbolic links in Windows

Surprisingly, all the good Windows features are hidden, undocumented and hard to find. It took me nearly a decade to accidentally find out that Windows has symbolic links. They are called NTFS Junction Points. However their support is limited to directory links, and the usage is a bit weird.

Oh, and you have to install Windows Resource Kit to get the functionality. You can download it from any of these locations:


The command you want is linkd. Let's take it for a spin.



The sandbox contains a directory named original with text.txt inside.

To create a symbolic link named symlinked that points to original, the command is linkd symlinked original. In POSIX it would be ln -s original symlinked.



When calling dir, symlinked shows as "junction". The other behavior is like a plain folder. In explorer you cannot tell the difference between the two.



To delete the symlink use rmdir, because del will attempt to remove the files from original directory.