Is it possible to create a symlink to a webdav directory on Windows?

8,826

Solution 1

Unfortunately symbolic links in NTFS can only point to locally mounted file systems and network shares via UNC paths: http://msdn.microsoft.com/en-gb/library/windows/desktop/aa363878(v=vs.85).aspx

Apparently this guy has a trick to mount a folder to a WebDAV destination though: https://discussion.dreamhost.com/thread-36105.html

Solution 2

You can use UNC path to create NTFS symlinks or Explorer shell links. You must be authenticated to the WebDav server prior access the link. For Explorer shell link I recommend CygWin tool "ln", because if you configure CygWin properly, shell links created by this tool can be interpreted as symlinks under CygWin runtime environment.

NTFS symlink

  • mklink /D "%WebDav_Link%" "\\%WebDavServer%\%WebDavRoot%\%RelPATH%"

Explorer shell link

  • "%CygWinBin%\ln.exe" -s '\\%WebDavServer%\%WebDavRoot%\%RelPATH%'
    '%WebDav_Link%'
  • to enable this works you must set under Windows environment a variable CYGWIN to "winsymlinks:lnk" (SET CYGWIN=winsymlinks:lnk)
Share:
8,826
Se Norm
Author by

Se Norm

Updated on September 18, 2022

Comments

  • Se Norm
    Se Norm almost 2 years

    I know I can map a webdav folder to a drive letter in Windows, but I need to map ~10 different webdav folders (different servers) and assigning a drive letter would be ugly.

    Is it somehow possible to create the links as a folder structure, for example by using mklink?

    I have tried several combinations (/d, /H, /J flag + https://webdav.server.com/... or \\webdav.server.com@SSL\...) without success. Most of the combinations lead to a virtual folder which when opened loads quite some time (as when the webdav is mapped to a drive), but then fails with similar error messages saying that it is not accessible.

  • mlt
    mlt over 9 years
    It doesn't like #/ at the end as suggested at the link you gave. It says The folder you entered does not appear to be valid. Please choose another.