45

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.

3 Answers3

58

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

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

17

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.

DavidPostill
  • 162,382
labiol
  • 179
0

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