This was a fun one – just as I thought I’d found the right solution I’d hit another roadblock. In the end, it wasn’t too bad, only a day’s worth of cursing.
I was trying to write a batch file (remember those?) on a Windows 2003 system that would get and put data from a SharePoint library by accessing the library as if it were an ordinary file share, i.e. \\sharepointserver\sharepointsite\library. The only problem was that the batch file didn’t seem to be able to access the library: a “net use” command would return a “The network name cannot be found” error. Trying to access the path in Windows Explorer didn’t work either: “Windows cannot find ‘\\server\path’. Check the spelling and try again, or try searching for the item by clicking the Start button and then clicking Search.” The only way I could access the library was if I went to the library itself and chose the Explorer View option. This would bring up an IE window with the address “http://server/site/library.” Unfortunately web addresses don’t really work too well when you’re dealing with batch files.
Considering that I eventually found myself working on the SharePoint server itself I figured it wasn’t a network issue. I knew the path was valid; it worked perfectly well on my own workstation (Windows XP). And I knew the “net use” command worked, because I’d done it before on another system (Windows Server 2008).
So the common factor seemed to be the operating system: Windows XP and 2008 would work, but Windows 2003 would not, because they saw the library as an actual web address and not a file share. A Google search led me to a blog post suggesting that a patch for Web Folders would do the trick. It didn’t, but it did have a link to a Microsoft whitepaper that would turn out to be very useful: Understanding and Troubleshooting the SharePoint Explorer View. A through (my first read through led me down another wrong path) read of this document led me to the solution.
As it turns out, there are two ways to access SharePoint libraries in Explorer: WebDAV and FPRPC. WebDAV is a newer protocol that allows the library to be treated as if it were a simple file share; FPRPC is an older one that treats them as web addresses with content that you can manipulate. WebDAV requires the Web Client service to be running. By default, it isn’t running on Windows Server 2003. So the reason I wasn’t able to get it to work was because Windows was unable to use WebDAV (since WebClient wasn’t running) to access the library and defaulting to FPRPC.
To enable the Web Client, you need to go into Services and change the “Startup type” for WebClient to “Automatic.” Viola, right?
Not just yet. Yes, you’ll now be able to get to the library via Windows Explorer, but you’ll also be prompted for a password. Unacceptable, since you can’t really enter passwords automatically in batch files (well, you can, but why would you want to?)
And that brings us to the other problem. As it turns out, “basic authentication” in Windows Server 2003 SP1 is turned off by default. It’s a good thing really, you don’t really want your passwords being sent out in clear text. Unfortunately SharePoint requires basic authentication to get Explorer view working fully, so you will have to add a DWORD key named “UseBasicAuth” with a value of 1 to “HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\WebClient\Parameters” in the Registry. Full instructions can be found here. You will need to reboot your system in order for this change to go into effect; I wasn’t able to get it to work simply by restarting the WebClient.
When the reboot finishes, you’ll be able to view your SharePoint library in Explorer via a network share path and mount it using “net use.” Now all that’s left is brushing up on those DOS skills of yours. You do remember DOS, don’t you?