9

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
  • 215
  • 1
  • 3
  • 7

2 Answers2

14

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
  • 156
  • 1
  • 4
  • 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 Aug 28 '13 at 20:15
  • Is there a security risk if I enable links from remote locations? Or some program's security model relies on this being disabled? I can't think of anything but maybe I am missing something. – user643011 Aug 07 '21 at 17:27
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
  • 7,667
  • 3
  • 33
  • 51
  • 1
    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 Jul 16 '12 at 10:05
  • 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](http://serverfault.com/questions/105633/mount-remote-cifs-smb-share-as-a-folder-not-a-drive-letter) – Robert Jul 16 '12 at 10:55