Sam
Sam

Reputation: 2200

Using mklink command with network drives

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?

Upvotes: 18

Views: 69254

Answers (3)

P. T.
P. T.

Reputation: 339

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

Upvotes: 22

Matthias
Matthias

Reputation: 97

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

Upvotes: 8

Nicholas
Nicholas

Reputation: 846

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.

Upvotes: 2

Related Questions