Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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.

share|improve this question
add comment

4 Answers

up vote 16 down vote accepted

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

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

share|improve this answer
    
+1 for links, Thanks! –  MMeah Jul 2 '12 at 10:47
add comment

You can use the /j switch to create a directory hard 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.

share|improve this answer
add comment

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

share|improve this answer
add comment

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

share|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 d C e Freitas Apr 9 '11 at 7:19
    
I see nothing special about c:\ in this case. –  Piotr Dobrogost Apr 9 '11 at 13:50
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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