Make hard links as I copy a directory

2

I would like to create a bat file to copy a directory, with everything in it (sub-directories, including hidden directories) - by making hard links.

I tested xcopy %source% %destination% /E /C /R /I /K /Y

I haven't seen anywhere an option to make hard links though...

Is there any way to copy and make hard links at the same time ?

Thalia

Posted 2012-08-22T01:42:23.333

Reputation: 490

What is the advantage of hard-links for each file instead of one soft-link for the whole directory? – Robert – 2012-08-22T08:31:08.970

Answers

0

I ended up writing my own script in c++, with the advantage (over kinokijuf's solution) of less overhead, plus I can choose which files to copy and which to hard-link.

Thalia

Posted 2012-08-22T01:42:23.333

Reputation: 490

4You should paste the source code here if possible, so that others can benefit from it, too. – Cristian Ciupitu – 2012-08-27T18:02:37.570

1

Use the Link Shell Extension. It has an option to create a „Hardlink Clone”.

kinokijuf

Posted 2012-08-22T01:42:23.333

Reputation: 7 734