2

On Windows 10. Here's what I type, and Windows' response:

mklink "path\to\link.pdf" "path\to\target.pdf"
Access is denied.

The desired location for the link is on a network drive. It makes no difference whether the target file is on the same network drive or on my local drive (the former is what I want, the latter I tried just to see if it made any difference, because I have no problems running this command between two locations on my local drive).

I came across these this cross-posted question here and here, which appear to describe an identical issue (though the OP was trying to create a directory link, not a file link). The OP never selected a right answer, though other commenters indicated two solutions worked for them:

  1. fsutil behavior set SymlinkEvaluation R2R:1 My setting was indeed off, but turning it on did not change the result.
  2. Turning off UAC and/or running as non-admin user. I tried both, and neither overcame the error.

There's also this thread that describes a similar issue, though none of the suggested steps resolved the OP's issue. I notice that all of these threads were regarding Windows 7, so it may be that something changed in Windows 10 that makes the proposed solutions no longer effective. Does anybody else have any insight?

1 Answers1

4

I was able to make this work with two changes: running the command prompt as administrator and granting the "create symbolic links" privilege to the user account on the machine hosting the network share.

Privileges can be configured with the Local Security Policy snap-in, secpol.msc. Open that on the computer where the network share is stored, navigate into Local Policies | User Rights Assignment, and open the "create symbolic links" item. Add the account you use to authenticate to the network share.

While one might not expect the privileges of your account on your machine to matter in this case, I suspect that mklink tries to enable the symbolic link privilege unconditionally. If that fails, it cannot issue the link creation command even if the other machine would accept it. Alternatively, you can grant yourself the "create symbolic links" privilege on your machine and not have to run as administrator.

Ben N
  • 42,308