I'm trying to create a windows cmd script that map a specific folder on a SharePoint server.

So far it work, but with too many restriction.

To use net use cmd I have to :

register on the website or I got the message:

System error 224 has occurred. Access Denied. 
Before opening files in this location, you must first add the web site to your trusted sites list, browse to the web site, and select the option to login automatically.

Click on "Library" > "Open with Explorer" or I got the message:

 System Error 53 Has Occurred.
 The network path was not found.

If I follow all those steps above I get the result:

Drive Z: is now connected to \\server@SSL\DavWWRoot\Share

I tried to use my credentials on the command line:

net use * \\server@SSL\DavWWRoot\Share /user:username password

But i still got the error 53

I visited a hundred webpages, testing all solutions, but nothing seems to work.

So far I think it's related to the web client of Sharepoint not running, but how can I start it from command line ?

  • I like people downvoting without explanation.. – Frennetix Oct 26 '16 at 13:41

I wonder of those hundreds of webpages you have seen,
If one of them was mine...

You have to let the IE Browser do the authentication, because the connection is established by an ActiveX control (that's why Open with Explorer only works on IE 32 bit)

So you manually have to Open Library with Explorer once.

Then you can map the connection

My blog has detailed description, AND the option to paste your library URL and built the NET syntax for you


The funny thing is.. you only need that manual browser authentication once.
You can even close the Browser and the connection will persist.


I came by the same problem, with just one simple difference, i could use the file explorer option. Below i will present you the links that helped me in resolving this issue and understand why this issue occured.

  1. https://www.lieben.nu/liebensraum/onedrivemapper/onedrivemapper-faq/#:~:text=Error%20224%20basically%20means%20the,to%20allow%20OnedriveMapper%20to%20work.

Error 224 in conjunction with ADFS (non persistent cookies) Error 224 basically means the webdav client did not find a proper cookie for Office 365 on your device, or the trusted sites are not configured correctly. If you’re using ADFS, you may have to set cookie persistence to allow OnedriveMapper to work.

  1. https://support.microsoft.com/en-us/help/2846960/error-when-you-open-a-sharepoint-document-library-in-windows-explorer

If you’re still having problems, like error 224, try installing this KB from Microsoft:

Error when you open a SharePoint Document Library in Windows Explorer or map a network drive to the library after you install Internet Explorer 10

  1. https://docs.microsoft.com/en-us/archive/blogs/sposupport/cookie-persistence-in-sharepoint-online#introduction

"Certain legacy features in SharePoint Online — Explorer view, for example — leverage legacy technologies like Windows WebDAV. WebDAV makes use of the browser's authentication cookie. Because of security concerns, WebDAV cannot access session cookies; only cookies that are written to disk are accessible by WebDAV. This means that in order for WebDAV to access the authentication cookie, the cookie needs to be persistent (persistent cookies are written to disk)*.

The easiest way to ensure cookie persistence is to check the "Keep Me Signed In"? box on the Office 365 Home Realm Discovery Page before entering your username and password. "

  1. https://answers.microsoft.com/en-us/msoffice/forum/msoffice_sharepoint-mso_winother/mapping-my-sharepoint-as-a-network-drive-on-my-pc/a654f04b-7932-41e9-92ce-4ebc65169335 "Please perform the following steps to check the outcome:
  1. Open IE -> Go to ‘Internet Options’ > Select ‘Security’ tab -> Select ‘Internet’ Zone > UnCheck the box for ‘Enable Protected Mode’

  2. Add https://*.sharepoint.com to list of Trusted Sites > Open https://tenant.sharepoint.com via Internet Explorer and select Keep me signed in before entering your credentials > After credentials are entered and you are successfully logged in to the site via IE, then try it again.

For more information: Map Network Drive / WebDav with SharePoint Online O365

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.