Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

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

share|improve this question

migrated from stackoverflow.com Oct 5 '12 at 21:59

This question came from our site for professional and enthusiast programmers.

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.

share|improve this answer

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

share|improve this answer

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.

share|improve this answer
18  
mklink doesn't exist on winxp, I believe. – skaffman Aug 23 '10 at 19:48
3  
mklink introduced in Vista – Kat Jul 11 '12 at 18:36

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

share|improve this answer

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

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

share|improve this answer

NATIVE Windows XP, 7, & 8 COMMAND:

Directory Junction:
mklink /J <oldpath(link)> <newpath(target)>

Making the newpath absolute, you'll be able to move link without breaking the pointer to the newpath. If you make the newpath relative, you'll be able prevent breaking the link, as long as you move BOTH the link and target TOGETHER and maintain their relative paths.

share|improve this answer
1  
mklink is not native to xp - it was only introduced on Vista. – cup Nov 7 '15 at 17:40

You create junction point with

REPARSE_MOUNTPOINT_DATA_BUFFER* pReparseInfo = // ...
pReparseInfo->ReparseTag = IO_REPARSE_TAG_MOUNT_POINT;
// ...
DeviceIoControl(..., FSCTL_SET_REPARSE_POINTFSCTL_SET_REPARSE_POINT, pReparseInfo, ... 

API call. pReparseInfo points to REPARSE_MOUNTPOINT_DATA_BUFFER structure you need to provide.

MSDN article has a community provided code snippet at the bottom of the page that shows how to use the API.

share|improve this answer

You can make NTFS junction with special software. I recommend Link Shell Extension (LSE). It is freeware and easy to use. It also has good documentation with screenshots of all steps.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.