Scott Hanselman

Mapping/Connecting a Drive Letter to a WebDAV or Front Page website

January 05, 2005 Comment on this post [4] Posted in Programming | Tools
Sponsored By

On the OT list recently the question was asked: "Does anyone know of an FPSE (Front Page Server Extensions/WebDAV) client that works on the command-line?"

The fellow basically wanted to XCOPY/COPY files from his machine to a remote site from the command line. I recommended the ridiculously powerful SynchronEX. I use it to automate the backup of my site from FTP (XFTP actually, maintaining file dates!) nightly, which is then backed up by my Iomega Rev Drive's Automatic Backup Pro Software. It's more than just a command-line tool, it's a complete scriptable beast with two-way sync and multiple remote file system support.

Later, John Schroedl responded with this built-in-to-Windows-XP tasty tip:

net use * http://www.webdav.org/ passwrd /user:username

He notes a caveat "Windows XP assumes that any WebDAV repository begins at the root of the server path. If a user mounts http://www.example.com/hr/ergonomics, then the OPTIONS request to http://www.example.com/ must show WebDAV support or the Redirector will fail."

For example:

C:\>net use * http://foo/Bar/SomeDirectory XXXXXXX /user:scott
Drive Z: is now connected to
http://foo/Bar/SomeDirectory.

The command completed successfully.

C:\>dir z:
Volume in drive Z has no label.
Volume Serial Number is 0000-0000

Directory of Z:\

12/22/2004  05:01 PM    <DIR>          .
12/22/2004  05:01 PM    <DIR>          ..
12/09/2004  03:37 PM             2,335 File.egp
12/22/2004  05:01 PM    <DIR>          TestDir
               1 File(s)          2,335 bytes
               3 Dir(s)   2,620,660,736 bytes free

From here you can use the command shell commands (XCOPY/COPY) to work with DAV as any other drive. A great tip!

About Scott

Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.

facebook twitter subscribe
About   Newsletter
Hosting By
Hosted in an Azure App Service
January 12, 2005 20:33
You can use NET USE X: \\sharepointserver\xxx\doclib1 to map a SharePoint doc lib to a local drive.
January 19, 2005 22:36
Hi Scott,
I was that fellow. :) Unfortunatley, this only works with WebDAV and not with FPSE, which use their own goofy protocol over HTTP. I'm still hunting for something that works with FPSE.
February 28, 2005 14:52
This is a great tip! And I have been trying to implement it, mapping drive N: to a WebDAV folder.
I'm having trouble getting the WebDAV Redirector to work with XCOPY and subdirectories. Everything works well with a single directory, but once I use xcopy /s I get:
File creation error - The directory is not empty
Unable to create directory - N:\winton\sub

Also, everything works perfectly if I copy and paste the files using Windows Explorer. The problem only appears with XCOPY.

I'm using XP Pro SP2 client and IIS 5.1 (also on XP Pro SP2) server.

Thanks for any thoughts.
July 22, 2005 14:09
Hi Scott
well I tried this, but I only get errors like Directory not found, etc. Do I have to start any services or need to set some special parameters?
Do you know much about the WebDAV Protocol?
The server log when I want to connect is:
http-80-Processor25, 22-Jul-2005 12:02:14, unauthenticated, PROPFIND, 207 "Multi-Status", 219 ms, /

when I connect via firefox the log is:
http-80-Processor24, 22-Jul-2005 12:07:35, unauthenticated, GET, 200 "OK", 172 ms, /

well now, do you think I have to change the server's config?
but how? and to what?
what servers do you use?

Many Questions, but I hope I'll get some answers
regards Tobias

Comments are closed.

Disclaimer: The opinions expressed herein are my own personal opinions and do not represent my employer's view in any way.