Access is denied error, when I mklink on Windows 7

Important points:

  1. You need to run as admin if UAC is on. (or at least security policy to allow creation of links).
  2. The /D switch needs to be used if the link is for directory.
  3. First parameter is a link, second parameter is the original folder.
  4. Link should not exist already.

Usage:

mklink /D c:\users\me\new_link\ c:\users\me\original_folder\

I found an answer from this site. In short, I should have run cmd.exe as Administrator.


Note that the same error will be presented when you try to create junctions on mapped drives. I was pulling my hair out on this until I came across the examples on this page on MSDN Hard Links and Junctions.

Short answer: you can only use mklink on local volumes.