Why can I create a remote directory through Windows Explorer, but not from the command prompt?

I'm using Windows 7 and have a remote folder available. Let's call it \\mycompany-portal\somefolder\attachments.

I can map a network drive to the folder root, so Z:\ points to \\mycompany-portal. I originally used the command prompt pushd \\mycompany-portal, however manual mapping through windows explorer makes no difference.

I note that the mapped drive is actually a DavWWWRoot

I can navigate to z:\somefolder\attachments in Windows Explorer and create a new folder therein successfully.

However, when I attempt to create a folder in this location from the cmd.exe command prompt using mkdir I get the error:

A device attached to the system is not functioning.

The mkdir command was mkdir 11112. The intention was for 11112 to be the Sharepoint call id. This fails, however mkdir blahblah works just fine in the command prompt

Why would this be?


The Sharepoint WebDAV folder in which I was trying to create the directory was itself linked to an 'Attachments' folder in Sharepoint. Each sub folder was named accordingly to the sharepoint ID number of the associated list.

The error occurred when trying to create a folder directly with a name comprising wholly of numbers. I'm still unsure as to why this might be.

Anyway, the reason it worked in Windows Explorer was that when creating a new directory there, Windows Explorer first creates a folder called "New Folder" and then renames it when you name it.

Trying this manually from the command prompt, i.e. mkdir xxxxx then rename xxxx 11112 demonstrated that it worked ok.

Given that this is WebDAV, all such requests are made through a RESTful API, so it is possible to sniff these with a packet sniffer (I used Fiddler). There I got a more indicative error message (though no more helpful).

Cannot create folder "somefolder/Attachments/1000001"