13

I have two network drives that I access through Windows 7: V:\ and T:\ I am trying to create shortcuts between the two that alphabetise with folders (rather than files), so I am using the mklink command:

mklink /d \Photos V:\Photos

which creates a symlink at C:\.

I can move the symlink around locally. However, when I try to move the symlink to a network location, it begins copy the actual files over rather than symlinking them.

I figure that if I can create a symlink of a network drive on a local drive, what's stopping me creating a symlink of a network drive on another network drive. Am I correct in assuming this?

Is there any way to designate the destination file path when creating symlinks with the mklink command? Or is there any way to move symlinks to a network drive at all?

Kara
  • 5,650
  • 15
  • 48
  • 55
Sam
  • 1,893
  • 2
  • 21
  • 37

3 Answers3

15

If you need to make a directory junction (using /J) on a network drive, you can first creation a directory (/D) symbolic link and then create a junction off of that, like so:

mklink /D D:\shareLink \\network\share
mklink /J D:\junctionLink D:\shareLink
P. T.
  • 171
  • 1
  • 3
  • 1
    Thank you, that worked form me to move iTunes backup to a mapped drive! The only thing you need to do is to rename the "backup" directory in the AppData to something else, otherwise it won't work. – Mike Aug 19 '18 at 21:37
  • 2
    Doesn't appear to be working on Windows 10. I get "The file cannot be accessed by the system." – Levi Roberts Oct 21 '18 at 16:14
8

You need to enable local to remote links by running this command with elevated rights:

fsutil behavior set SymlinkEvaluation L2R:1

Also you can enable this with your local or group policy: Computer\System\Filesystem\Selectively allow the evaluation of a symbolic link --> allow local to remote

Taegost
  • 1,098
  • 1
  • 14
  • 23
Matthias
  • 97
  • 1
  • 3
2

You will need to log onto the computer hosting the network drive and run the mklink command from there.

I recommend creating a junction /J instead of a symlinkd /D. Symlinks have some additional settings you need to be aware of. See symbolic-link-cannot-be-followed.

Community
  • 1
  • 1
Nicholas
  • 698
  • 6
  • 14