Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How can I create hardlinks for a file on an NTFS partition using Windows?

NTFS can obviously handle hardlinks, since creating them with NTFS-3g works – the links even work in Windows. Is this the only way to create hardlinks on NTFS?

share|improve this question
add comment

3 Answers 3

cmd includes the mklink command which can create hardlinks:

Creates a symbolic link.

MKLINK [[/D] | [/H] | [/J]] Link Target

/D Creates a directory symbolic link. Default is a file symbolic link.

/H Creates a hard link instead of a symbolic link.

/J Creates a Directory Junction.

Link specifies the new symbolic link name.

Target specifies the path (relative or absolute) that the new link refers to.

Furthermore, the excellent Far Manager has support for creating them (Alt+F6).

There are also a number of shell extensions that allow for doing so.

share|improve this answer
    
wow, even softlinks. didn't know they even existed in windows. or is it those .lnk files? good answer, i didn't know that command –  knittl May 16 '10 at 16:16
2  
.lnk files are shortcut files -- a shell-level item. Symlinks are an NTFS-level link. –  afrazier May 16 '10 at 17:37
    
i tried this today, cmd.exe does not seem to recognize mklink. OS was windows xp –  knittl May 18 '10 at 7:44
    
@knittl: I was assuming a recent version of Windows. You know, one that still has mainstream support. mklink exists since Windows Vista (mostly because NTFS didn't gain symlink capabilities before that). –  Joey May 18 '10 at 13:20
1  
NTFS features changed with every major Windows version so far. Vista brought transactions and symlinks, Windows 2000 added reparse points, quotas, sparse files and more, etc. –  Joey May 18 '10 at 21:30
show 2 more comments

You can use Link Shell Extension to easily do what you want

share|improve this answer
    
+1: LSE is awesome! –  afrazier Apr 10 '11 at 1:39
add comment
fsutil hardlink create new_file old_file_name

You will need to run this from an elevated command prompt.

share|improve this answer
add comment

Your Answer

 
discard

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.