How to create an NTFS junction?

How can I create an NTFS junction point in Windows XP?


By default Windows XP dosn't have tools to make junction point. This tool (linkd) is part of Windows Resource Kit Tools.

Another tool is junction by Mark Russinovich.


Is your definition of junction point a directory that is hardlinked to another one?

If so it is simple

mklink /J <new directory to be linked> <target directory>

After this there is no distinction between the directories. They have the same MFT_REF (from http://en.wikipedia.org/wiki/NTFS_symbolic_link).

fsutil can also be helpful to query reparse-points and make hardlinks.

If you wanted to know how to programmatically do this, you can us NTFS storage driver IOCTL calls on the volume handle. But it would be easier to just call mklink.

Be advised that you have to have write and modify privileges for the target directory. You will need to run cmd.exe elevated for it to work.


Try junction utility from Sysinternals, it's available on W2k+


You may also use Link Shell Extension as a GUI-oriented interface. It can create junctions, hard links and even symlinks on Windows XP if you install the NTFS 5 filter driver from Masatoshi Kimura as described. http://schinagl.priv.at/nt/hardlinkshellext/hardlinkshellext.html


Here's the "live" link for junction.exe.

http://live.sysinternals.com/junction.exe