Access is denied on mklink

8

4

I am trying to get a symlink working over a network drive.

I have already tried suggestions on questions already asked, such as running as administrator and checking if the directory already exists. Unfortunately it still gives me the following error:

C:\Windows\system32>mklink /d \\myserver\SomeDir\SomeLink \\myserver\SomeOtherDir\MyDir
Access is denied.

Where SomeLink is the link I am attempting to create and Mydir is the directory I am trying to create it on.

Any ideas how I could get this working? The local machine is running windows 7 and the remote machine is running windows server 2008 R2 standard.

Blueberry

Posted 2012-07-16T09:04:01.113

Reputation: 205

Answers

12

Robert is wrong. Remotely mklink DOES work. Here is the solution:

Run command prompt as admin and then run this command:

fsutil behavior query SymlinkEvaluation

If you see message "Remote to remote symbolic links are disabled.", then run this command:

fsutil behavior set SymlinkEvaluation R2R:1

After that, you can run

mklink /d \\myserver\SomeDir\SomeLink \\myserver\SomeOtherDir\MyDir

Anup

Posted 2012-07-16T09:04:01.113

Reputation: 136

Well, ill be damned, it works. Good first answer, welcome to SuperUser! I hope your future answers are as informative as this one. (FYI to people using this, the network link worked fine for me, but I had another person connect to the remote machine from his machine, they could see the link but got a permissions error when they tried to follow it) – Scott Chamberlain – 2013-08-28T20:15:07.843

0

By default mklink only affects the local computer. Remote manipulations are not possible in that case.

Therefore if you want to add a symbolic directory link on a remote machine try to execute mklink.exe via PsExec on the remote server, then using the local directory path of the two directories.

Robert

Posted 2012-07-16T09:04:01.113

Reputation: 4 857

I thought that was the difference between symbolic links and NTFS junctions - that they could work over network locations. http://superuser.com/questions/343074/directory-junction-vs-directory-symbolic-link

– Blueberry – 2012-07-16T10:05:17.877

That linked answer is working locally (\alice\C$ from computer alice becomes C:), but uses the share name. What you can do is mounting a remote share to a local directory: Mount Remote CIFS/SMB Share as a Folder not a Drive Letter

– Robert – 2012-07-16T10:55:49.940