Using mklink /h results in "Access is denied."

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.


Solution 1:

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

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

Solution 2:

You can use the /j switch to create a directory soft link. Be careful with the del command. To remove link to directory use the rmdir command, as del will delete all files in the directory the link points to.