From command prompt with Administrator privilages:

c:\>mklink /h c:\dirA c:\Users\Piotr\dirB
Access is denied.

I'm on Vista x64. Using /j or /d instead of /h works. What's the problem?

Related:

Access is denied error, when I mklink on Windows 7.

link|improve this question

50% accept rate
feedback

3 Answers

up vote 4 down vote accepted

Hard links can only be used for files, not directories.

References: MSDN: Hard Links and Junctions, <1>, and <2>

link|improve this answer
feedback

I had the same issue: check that the file or folder that you are trying to create doesn't already exist (c:\dirA).

link|improve this answer
Folder c:\dirA does not exist. – Piotr Dobrogost Apr 8 '11 at 21:15
OK, in this case, it's probably because it's being created on the root of c:\, see if creating it in another directory helps? – David Freitas Apr 9 '11 at 7:19
I see nothing special about c:\ in this case. – Piotr Dobrogost Apr 9 '11 at 13:50
feedback

As far as I know hard links are allowed for files only, not directories. http://technet.microsoft.com/en-us/library/cc753194(WS.10).aspx

link|improve this answer
feedback

Your Answer

 
or
required, but never shown

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