Scott Hanselman

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

January 5, '05 Comments [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
Sponsored By
Hosting By
Dedicated Windows Server Hosting by SherWeb

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