XP: Create a Hard Link Reference to a File with fsutil

Posted April 8, 2004 by Quinn McHenry in Windows

UNIX users have long used symbolic or hard links to create a new reference to an existing file. Windows XP has a new function called fsutil which, among other interesting filesystem utilities, allows the creation of hard links on an NTFS volume. The referenced file behaves exactly like the original file.


To create a hard link of the file OLD.TXT in the current working directory to a new file called \TEMP\NEW.TXT, use the following command:

fsutil hardlink create \TEMP\NEW.TXT OLD.TXT

Note: the syntax is opposite that of the UNIX ln command.

Both OLD.TXT and NEW.TXT are references to the actual file on disk. Deleting the hard link (NEW.TXT) will only delete the link, not the original file. Deleting the original file (OLD.TXT) also will not delete the actual file as long as another hard link to the file exists.

 

About Quinn McHenry

Quinn was one of the original co-founders of Tech-Recipes. He is currently crafting iOS applications as a senior developer at Small Planet Digital in Brooklyn, New York.
View more articles by Quinn McHenry

The Conversation

Follow the reactions below and share your own thoughts.