Mapping WebDAV folder as a network drive letter

Web-based Distributed Authoring and Versioning (WebDAV) is an extension to the HTTP protocol, which makes it possible to manage files on a remote Web-Server. WebDAV is preferred when clients has to connect through an insecure network (like the Internet) to reach the remote server, as the remote server can be protected by a firewall and only leaving the HTTP port open and allows SSL instead of using VPN.

Windows XP includes the WebClient service that allows one to mount a Web Folder as a mapped network drive:

net use x: "http://server.com/folder" /User:UserName Password

Note to make the mapping permanent add the parameter /persistent:yes

Note Windows XP can only connect to port 80 and can only map to a sub folder and not the root directly.

If wanting to make a secure SSL mapping using the https protocol at port 443:

net use x: "\\server.com@ssl:443\folder" /User:UserName Password

net use x: "https://server.com/folder" /User:UserName Password

Note Windows XP only supports SSL / https connections when using My Network Places, but can be tricked into using SSL with net use by creating a forward server using stunnel. More Info Simple Groupware WebDAV.

Windows Vista can create a network drive without needing to dive into the command line:
  1. Click on the Start menu and choose Computer.
  2. Click the Map network drive button in the toolbar.
  3. Select the drive-letter and enter the WebDAV location in the Folder using the http address.
  4. Click the blue link "Connect using a different username" to specify a different user account and password, than the Windows user account.
  5. Click Finish to create the new drive letter.
Note there is an update available for Windows XP/Vista for better support of WebDAV folders (Will be part of XP SP3 and Vista SP1). More Info MS KB 907306.
  • The latest version of the Web Folders update (2.0) doesn't support Windows 98, Me or 2000. Instead one should use version 11.0.6715.15 Download Webfldrs-KB892211-ENU.exe.
  • Windows Vista SP1 (and older) has a known bug where it cannot access sub-folder unless it has read-access to the parent folders. More Info MS KB942392
Note if using Windows 2000 or earlier, then one must use a 3rd party utility to map a WebDAV folder as a network drive.

Note MS Office (2000+) includes its own WebDAV client which supports file locking and SSL, but will only work when accessing files through the office applications (Excel, Word, etc.). More Info MS KB 838028

Note to setup a WebDAV server for the clients to connect to, then one can use IIS or try one of these freeware servers: More Info Lists WebDAV clients in MS Office (and their bugs)
More Info Lists WebDAV clients in Windows (and their bugs)

Updated: 6 March 2009

Comments:

  1. Jim says:

    The only way I can get a webdav folder to map is in the My Network Places folder. When you try to map a drive, you get an error "The network path https:\\webdav.rrmm.com could not be found". The same with Net Use. The server is not on the domain, could this be the issue?

  2. snakefoot says:

    Jim
    When you try to map a drive, you get an error "The network path https:\\webdav.rrmm.com could not be found".

    What operating system ?
    Does it work with standard http instead ?
    What if you specify the port-number https:\\webdav.rrmm.com:443 ?

  3. coldb00t says:

    It seems you need to use

    \\www.rrmm.com@SSL\

  4. snakefoot says:

    coldb00t
    It seems you need to use

    \\www.rrmm.com@SSL\

    Thank you for the update about how to use WebDAV with SSL. Have added the details to the article.

  5. Patrick Paulson says:

    Thanks for this information — it’ll make sharepoint a lot more useful. I used the command
    $net use z: “http://<path-to-sharepoint-folder>” /User:

    to connect to a folder that is at "https://<path-to-sharepoint-folder>". I don’t know why that should work, but it did.

  6. John Call says:

    I have confirmed that using http://site instead of the SSL version https://site works for Windows XP SP2. But is there any way to confirm that the data is actually encrypted? With Windows Vista Enterprise I can use the SSL version without problem.

    Thanks,
    John

  7. snakefoot says:

    John Call
    But is there any way to confirm that the data is actually encrypted?

    If the connection hits port 80 of the Web-server, then it is most likely not encrypted using SSL. Have looked around and seen many reports that XP does not support SSL connections and can only access WebDAV using port 80. Found Simple Groupware WebDAV about how to configure stunnel to convert the WebDAV connection to SSL.

  8. Wayne says:

    https on XP sp 2 works for me; although I can't use the net use command. I had add it with Network Places.

  9. Snakefoot says:

    Wayne
    https on XP sp 2 works for me; although I can’t use the net use command. I had add it with Network Places.

    Have updated the article about it only being the "net use" command in XP that doesn't support SLL and one can still use My Network Places.

  10. snooy says:

    This does not seem to work for windows xp and webdav (without SSL)..

    I can mount the webdav server with a web folder but cannot map it to a drive letter by any of the means described above.

    I have read that windows XP cannot do this at all, but windows 2000 can, so I am curious to how exactly people got this working on XP..

  11. Shelon Padmore says:

    Doesn't seem to work from XP
    - Shelon Padmore

  12. Marco says:

    Hi,
    I have setup a webdav server on apache2 ( debian etch ) . Connecting from a browser works as a pie ( username/passwd ) . Providing the same username/password couple does not work from xp sp2 either mapping a drive or netuse from a shell .
    Trying the "open as webfolder" from ie gives an error but maps the webfolder ( i can't create or open docs there thou )

    I tried both enabling and disabling ssl on apache .

    Any idea ?

    Thanks

    Marco

  13. ps says:

    Thanks very much for creating this page. I have been going nuts trying to map a network drive to a web folder. My problem was that I was using tomcat webdav servlet and that doesn't work. I switched over to Apache 1.3.2 and Mod dav and now I'm able to map a network drive to a web folder. My setup is very simple though. No SSL, no authentication etc.

  14. nikhil says:

    Can you please explain the step u did to switch from tomcat to apache and mod dav

  15. Mario says:

    Hi,

    this works for me on both Vista and XP (although we had to add HTTP header on IIS) but I ran into another "problem". Every time I login either to XP or Vista mapped network drive I created is disconnected and I have to type my username and password. I solved this issue on Vista (with SP1 and KB943280) but on XP it just won't work! Seems like I hit the dead-end with this one... Did someone solve this one?

  16. sico says:

    I have trouble to with mounting webdav to Windows XP drive. I using tomcat webdav, but unfortunately I can't switch server to Apache.
    When I try to connect windows throw the message:"The network path http:\\localhost\folder could not be found". Port is 80.
    I was trying NetDrive but its very buggy. It crashes my Windows Explorer every time.

  17. John Wells says:

    I have the same issue with XP. Tried all of the above. Can add a folder to network places and show it on the desktop, but cannot map to a drive letter. If anyone has an idea would appreciate it. Microsoft Network environment.

  18. Eric Nowell says:

    I have tried this and I am not using SSL (atleast it is a http:) and it gives me system 5 error has occurred

    Access is denied.

    I do have access because I can access it directly through IE.

    any ideas?

  19. Igshaan says:

    If you get an error message in either windows or vista to map a SSL site or remote http folder, then first log in via the browser and then map the folder while you are logged in.

  20. David Earl says:

    I was getting Access Is Denied too, and after a lot of experimenting, I discovered that NET USE seems to be doing a PROPFIND on the dav server *before* authenticating, which the server naturally refuses if the Dav Location in the apache conf requires user authentication unconditionally.

    By placing the "AuthType...","Require valid-user", " etc in the Apache config inside "" (thereby allowing an unprotected PROPFIND to work) NET USE then succeeds.

  21. Daniel le Rouge says:

    Hi!

    I am trying to connect to my company's server via WebDAV, but it does not work, because our server uses port 81. Is there any workaround, so that I can access the server on XP. In Linux, Mac OS and Vista there were no problems.

    Thanks!

    Daniel

  22. Mark Gunn says:

    I have been successful in mapping a https to a drive in XP, by first setting up a tinyurl first for the https folder, and then mapping to this.

  23. dennis says:

    Hi,

    And thanks for this good tutorial!

    I got this working via http, but the only problem is that Windows repeatedly asks for the password (the username is stored). Repeatedly meaning after the http session dies or so, so i'm unable to have a sync scheduled cause the authentication isn't permanent (although it is set to "remember my password". So every time the pc is booted, i have to enter the credentials to access the drive (plus the mapping of the drive takes 20 sec or so:).

    Does anyone know if this can be fixed?

    Thanks!
    - Dennis

  24. Dave Hunt says:

    I couldn't get Stunnel to work for connecting to HTTPS WebDav on xp, but the tinyurl idea worked like a charm! Thank you Mark Gunn!!!

  25. Joe says:

    Mark, could you please explain more detailed how you did this? Thank you very much

  26. Devon says:

    I'm pretty sure this is what Mark means:

    You can set a non-SSL redirect into your SSL site and the webclient will follow the redirect, effectively allowing you to mount an SSL webdav in XP.

    I've found 2 drawbacks:
    1) Requests are sent to the non-SSL webdav in cleartext. Note however that the authentication data is NOT sent with this request, only for the SSL request.
    2) Renaming files/directories doesn't work.

    -Devon

  27. Devon says:

    Also XP keeps trying to connect to the webdav over netbios from all local IPs, which can lead to significant delays if your system is connected to multiple networks (for instance if you have VMware installed or you're connected to a VPN).

  28. Devon says:

    There's a solution to the file rename problem at:

    http://stackoverflow.com/questions/1110710/webdav-behind-a-reverse-proxy

    In a nutshell you have to re-write the Destination header that the client sends with a MOVE.

  29. Robert Shelton says:

    Has anyone found a solution for Win7? I was able to access the drive letter (Y: in my case) for a period of time, then it no longer was accessible. I am able to access the Network Location. So my problem is that I can't access SharePoint as a drive even though I can explore it. Makes mirroring to my local PC very difficult.

  30. ko0kie says:

    hi
    I have set up the tomcat WebdavServlet, I can access it via browser (read-only) or via Webdrive Client but if I can't mount it as a network drive in Win XP or even Win 7. When I try to use the "net use" commmand an error occurs: "System error 67 has occurred. The network name cannot be found."

    anyone knows what to do?

    thanks in advance

  31. Paul says:

    I'm trying to map a https to a drive in XP, by first setting up a tinyurl first for the https folder, as described by Mark Gunn above but when I connect the drive I am asked for a username and password. Neither my local username nor the https destination username work. Does any know what username is required?

  32. Dom says:

    Are you on a domain? You generally have to enter the username as DOMAIN\username. Out of interest this is how I mount our Sharepoint site internally as a drive letter from SBS2003 server using a VBS login script:

    objNetwork.MapNetworkDrive "T:", "\\companyweb\DOCUMENTFOLDER"

    or externally from IE:

    https://EXTERNALIPADDRESS:444/DOCUMENTFOLDER

    Open Internet Explorer on your computer, go to the ‘Tools’ menu and select ‘Internet options’, and then choose the ‘Security’ tab.

    # Click on the ‘Trusted Sites’ zone icon, and then the ‘Sites’ button.

    # That will give you a second box, where can add the website address ‘https://EXTERNALIPADDRESS’ (don’t include the quotes).

    # Click ‘Close’

    # Now click the ‘Custom level...’ box and scroll right to the bottom of this list to where it says ‘User Authentication’

    # Select the check box ‘Automatic logon with current user name and password’

  33. Dom says:

    This stops you keep getting asked for username and password if not on the domain:

    Open Internet Explorer on your computer, go to the ‘Tools’ menu and select ‘Internet options’, and then choose the ‘Security’ tab.

    # Click on the ‘Trusted Sites’ zone icon, and then the ‘Sites’ button.

    # That will give you a second box, where can add the website address ‘https://EXTERNALIPADDRESS’ (don’t include the quotes).

    # Click ‘Close’

    # Now click the ‘Custom level…’ box and scroll right to the bottom of this list to where it says ‘User Authentication’

    # Select the check box ‘Automatic logon with current user name and password’

  34. Dan says:

    To get this to work with stunnel (avoid system error 67) with apache 2.2(no simple groupware), after watching some debug logs,I had to had to address 2 issues in the apache
    conf.

    1) The directory or its alias or both should be defined without the trailing slash. This is required even to connect without ssl and tunneling. It does not matter if the slash is included in the net use command or not, the minirederector (net use) always asks for the URL with no slash. In some cases a browser seems to get past this, but I haven't fully understood it.

    2) Add:
    DirectorySlash Off
    to the directory section.

    The issue here is related to the fact that addresses without a trailing slash are not considered "canonical" urls and are redirected by default to the address with the slash. I believe, with UseCanonicalName Off (which I have) this should still redirect to a 127.0.0.1:80 address but I'm not sure. Anyway The browser follows the redirect somehow, but the mini-redirector (net use) does not and fails. The DirectorySlash off command disables the redirect and delivers the goods immediately. A small side effect is that if you have /davdir/index.html, entering 127.0.0.1/davdir with no slash, will give a directory listing but for a webdav mount we probably don't care about this "security" issue. There may be other combinations of settings that get around this, and I'm not an apache expert, so they might even be more reasonable, but this worked for me.

    In total (insert brackets around Directory tags):

    DocumentRoot /web/davdir
    < Directory /web/davdir >
    DirectorySlash Off
    Dav on
    ...
    < /Directory >
    alias /davdir /web/davdir

    I then just used
    net use x: "http://127.0.0.1/davdir/" password /USER:username

    I use digest authentication but basic also works with the registry fix.
    It seems the tools map network drive also works if you reboot first and select the "different user name" option as documented in a microsoft bug.

  35. Dan says:

    To clarify. I'm using SSL/https port 443 on the server.

    THIS DOES WORK WITH SSL ON XP using STUNNEL even WITOUT simple groupware, just plain apache.

    you just must use net use with the username and password on the command line (not using the prompt) must setup stunnel with all the right options (client=yes, verify=no) and must get the trailing slash issues worked out on the server config. It's not that simple, but it does work.

  36. Dan says:

    the solution to the stunnel rename bug pointed out above.. here:
    http://stackoverflow.com/questions/1110710/webdav-behind-a-reverse-proxy

    does not work. You need to reverse the logic like this:

    LoadModule headers_module /usr/lib/apache2/modules/mod_headers.so

    RequestHeader edit Destination ^http: https: early

    I just reversed http and https. I believe the original solution was in a different context.

    If you want an amazingly long but good explanation of the problem it's here:

    http://www.stunnel.org/pipermail/stunnel-users/2009-October/002467.html

    ..with a more complicated fix because author specifically says that changing https to http isn't possible. Either he didn't know, or that's a new command.

    Either way, you can't make SLL drive mapping work in XP without control of the server.

  37. Dan says:

    P.S. if you read the last two links I posted you might think the rename solution would solve the trailing slash problem too since they are both redirect problems... but you'd be wrong. (and I don't know why). I need both solutions.

  38. Tom says:

    I noticed another glitch on XP SP3 with net use, Win 7 doesn't have the problem. If you try to use something like the following

    net use x: "http://server.com/folder/subfolder" /User:UserName Password

    Then you get the "System error 67 has occured. The network name cannot be found". It works fine with Window 7. Looking at sniffer trace comparing XP to Win7 I can see that the MS Webdav mini-redirector for XP when it sends the PROPFIND to the Webdav server uses only "PROPFIND /folder" in the request, not "PROPFIND /folder/subfolder" which I do see with Win 7.

    I haven't found any way to work around this, if anyone has any ideas please let me know.

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>