betweenGo

NTFS Junctions

by on Sep.18, 2008, under Windows

Windows NTFS has a nice but relatively unknown feature called NTFS junctions.  It is like hard links in Unix except it is only for directories.  Microsoft has a KB article about it which points to several utilities.  However I have been using Mark Russinovich’s junction tool exclusively.

Using Junction

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

-s Recurse subdirectories

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

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

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

Here is an example of using junction.  Note that the order of arguments is opposite of the Unix ln command.

> junction foo d:\docs\foo

The above example will create a junction called “foo” in the current directory.  This junction will point to d:\docs\foo.

To do the same in Cygwin:

$ junction foo `cygpath -aw /d/docs/foo`

One tip is to use the DOS dir command.  It will display <JUNCTION> instead of <DIR> in directory listings for junctions.

Share

Related posts:

  1. Perforce Adding a Directory Tree
  2. Microsoft Windows Vista Error 0×80070091 and Cygwin
  3. Windows hosts file not working
  4. Unable to start Cygwin shell from Windows command prompt


Leave a Reply

 

Looking for something?

Use the form below to search the site:

Still not finding what you're looking for? Drop a comment on a post or contact us so we can take care of it!