You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 9 Next »

Windows has had Unix-style symbolic links and hard links since NTFS 5.0 (meaning Windows 2000 and later), but many Windows users don't seem to know about them. These are not the relatively useless Windows Shortcuts that appear on your Explorer context menu when you right-click. The article Windows Symbolic and Hard Links on shell-shocked is a great article on the subject, but I thought I would put a little quick HOWTO blurb here for GLAST users.

All of the following tools are free (as in price).

Although this functionality is built-in to Windows 2000/XP, there are several extensions available to make working with symlinks more comfortable from Explorer since Microsoft didn't include this functionality in the context menu. My favorite tool is NTFS Link.

NTFS Link is a Shell Extension that provides its functionality through the Explorer context-menu when you right-click. In the figure below, notice the NTFS Junction Point and NTFS Hardlink options.

For you command-line users, this is the blurb (cut-and-pasted) from the Sysinternals about a small wrapper script by Mark Russinovich to make command-line useage more pleasant:

Win2K's version of NTFS supports directory symbolic links, where a directory serves as a symbolic link to another directory on the computer. For example, if the directory D:\SYMLINK specified C:\WINNT\SYSTEM32 as its target, then an application accessing D:\SYMLINK\DRIVERS would in reality be accessing C:\WINNT\SYSTEM32\DRIVERS. Directory symbolic links are known as NTFS junctions in Win2K. Unfortunately, Win2K comes with no tools for creating junctions - you have to purchase the Win2K Resource Kit, which comes the linkd program for creating junctions. I therefore decided to write my own junction-creating tool: Junction. Junction not only allows you to create NTFS junctions, it allows you to see if files or directories are actually reparse points. Reparse points are the mechanism on which NTFS junctions are based, and they are used by Win2K's Remote Storage Service (RSS), as well as volume mount points.

If you want to view reparse information, the usage for Junction is the following:

Usage: junction [-s] <directory or file name>

-s Recurse subdirectories.

If you want to create or delete a junction, use Junction like this:

Usage: junction [-d] <junction directory> [<junction target>]

To delete a junction specify the -d switch and the junction name.

Download Junction (16KB)

Download Junction Source (22 KB)

  • No labels