Windows hard links for directories

3

How can I make hard links for directories in Windows 7? That means that the 2 (or more?) linked directories refer to the same inode (group of inodes) so they will be exact duplicated and every change to the one will also affect the other. If I add a file (or change a file) in the one file that file will also be added/changed at the other directory because it's internally the same directory.

How can I do this?

Michael

Posted 2012-02-13T18:34:14.363

Reputation: 218

1Try Use mklink /d /h linkname target – soandos – 2012-02-13T18:41:45.147

Answers

1

I found an interesting tool named Link Shell Extension doing exactly this.

Michael

Posted 2012-02-13T18:34:14.363

Reputation: 218

While I agree that may be a useful tool, it cannot make a hardlink to to a directory, if it is working on directories, then it is creating junction points. – Zoredache – 2012-02-13T19:13:56.777

@Zoredache Yep, exactly. It's using junctions. – Michael – 2012-02-13T19:15:29.043

2

You cannot create a hardlink to a directory. See the 'following are not' examples on this article about Hard Links and Junctions. Mklink calls the CreateHardLink function and if you look at the description you see this summary.

Establishes a hard link between an existing file and a new file. This function is only supported on the NTFS file system, and only for files, not directories.

You can create a junction (symlink), but hardlinks to directories are simply not valid on most systems..

Zoredache

Posted 2012-02-13T18:34:14.363

Reputation: 18 453