What are hardlinks on windows 7?

Posted on


What are hardlinks and how are they different from files?

If i have a hardlink would all apps believe the link is a file? (I had programs not open files because they were shortcuts)
If i modify a hardlink, does it modify the original or create a copy and modify that?


When you save a file on an NTFS filesystem, it creates the file somewhere on the drive, then creates a reference to it in the Master File Table (MFT). When a program requests a file, Windows looks in the MFT for the filename, and if found, returns the information the filename points to.

A hard link takes an existing file (or folder) and creates another, different entry in the MFT that points to the same data. To programs, both files look like different files with the same information, but they are actually the same file. If you modify one file, the other one is changed too because they are actually the same file going by two different names.
Hard Link diagram

This is different from a shortcut, because a shortcut is actually a file itself that contains information about the target.
Shortcut diagram

From the Developer’s Tidbit:

For Window users unfamiliar with hard links, they not are unlike file and folder shortcuts. Except for one critical difference they are sorted and registered by the operating system’s file partition just like real files and directories. This means that unlike a shortcut, any program or application (including Windows Explorer and the Command Prompt) that looks that the hard link will always treat it the same as the original file or folder the symbolic link is pointing to.


Check out this article from the How To Geek:


From MSDN:

Hard Links and Junctions

Leave a Reply

Your email address will not be published. Required fields are marked *