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
    
Not sure if this is what you're after, but I tried mklink w/o any flags to try to link a directory and it didn't give me what I wanted. I tried using the \D flag and that seemed to work (not sure if that's different than \d or the default, which some ms docs said was 'symbolic'). –  jinglesthula Jul 2 at 16:12

4 Answers 4

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

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

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

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

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.