Following Windows SymLinks in network shares

12,448

The target of the Symlink needs to be able to be accessible by readers. In your case...

E:\
|- Folder1\
|- [share]Folder2\
      |- slF1

If 'slF1' points to "E:\Folder1\" clients will not be able to access it. In fact, if you'd done this:

E:\
|- Folder1\
|- [share]Folder2\
      |- Folder3\
      |- slF3

And made "slF3" a link to "E:\Folder1\Folder3" it STILL wouldn't work since Clients don't know how to access "E:\". However if you had made "slF3" a link to "\\Server\Share\Folder3" it would work just fine. To make it work the way you want it to work:

E:\
|- [F1Share]Folder1\
|- [F2share]Folder2\
      |- slF1

Made "slF1" a link to \\server\F1Share\ and it should work just like you need to.

mklink /D slF1 \\Server\F1Share\

The thing to keep in mind is that a symbolic link is a path that is followed explicitly by clients, as if it were a Shortcut icon. What you link to will be what clients attempt to attach to. Shares do not derefence links before serving them up, clients have to support them. That might be a problem with older clients that can't handle junctions.

The reason sharing it directly works is because Windows is actually sharing E:\Folder1 in that instance, and the symlink is never touched by clients.

Share:
12,448

Related videos on Youtube

Matt
Author by

Matt

Updated on September 17, 2022

Comments

  • Matt
    Matt almost 2 years

    I have a shared folder, let's call it

    e:\folder2\
    

    'Everyone' has read permission to the share and file system.

    From a command line, with pwd at

    e:\folder2\
    

    I ran

    mklink /D slF1 e:\folder1
    

    The permissions for both folders(folder1,folder2) are identical (Everyone has read access for network access and file system access)

    When I try to open

    \\thismachine\folder2\slF1\
    

    I get an accessibility error.

    Can this even work? If so what's the trick?

    EDIT: If I share the symlink slF1 directly, it works -- that is, I can share \thismachine\slF1\

    EDIT II: I tried what sysadmin1138 suggested. I just couldn't get it to work unless I ran:

    fsutil behavior set SymlinkEvaluation L2L:1 R2R:1 L2R:1 R2L:1
    

    and then, I had to use junctions for directories and hardlinks for files. This is a bit weird. Am I missing anything? I'll accept your answer tomorrow morning. Thanks!

  • Matt
    Matt almost 14 years
    Thanks sysadmin1138! Info helped me a bit -- see EDIT II