No one has responded to this discussion for at least a year, so this information may be out of date. If you're looking for information about this topic, please search for a more recent discussion or post a new question.

Intermittent problem with sharepoint folder mapping as a network drive - win7

This question has suggested answer(s) This question has suggested answer(s)

hi guys


please help, i've been having issues with maping a sharepoint folder using "net use" command. It is an intermittent problem and can't find a good solution for it.


prior running this "net use" command (it's in a batch file) we always make sure that the user is logged in to the microsoft365 sharepoint website. Fyi, we've put the sharepoint website address in the trusted website (IE), we've made sure that webclient service is running. Unfortunately, the net use command doesn't always successfully map the sharepoint folder as a network drive.


when we cannot map the sharepoint folder, what we do is either restart the webclient service, or restart the computer, or try to open the sharepoint via explorer and run the net use command again. But this work around doesn't always work either.


fyi, we're running this on Windows7


Please help. thank you

All Replies
  • Hello,

    I am seeing this error too.

    If I do a "net use" after logging on to Windows 7, it fails.

    If I connect to SharePoint, open a document library, and say "Connect to explorer", the connection works fine.

    From that point, "net use" will work just fine on ANY document library.

    It seems the "Connect to explorer" triggers something to allow the "net use" to work.

    What I need to find is a way of getting "net use" to work without manual "connect to explorer" step, as I want the "net use" to run in a logon script.

    Sorry, I don't have an answer, but hopefully more insight as the the issue.

  • Hi mrs4m,

    SharePoint Online (SPO) requires an active security token before it will allow you to map a drive letter to a SPO site.  The security token expires every 7-8 hours.  When your NET USE command makes a mapped drive call to the desired SPO site, it requires an active security token.   Without that token, NET USE will not have permission to resolve the address and map the drive.  Once that fails your batch file will move on and not map that drive as requested.

    Since it looks like you have already verified your IE settings and your webclient service, I would like you to next verify that your computers have the latest updates installed and configured for use with SPO Office 365.  Please review the flowing links that detail how-to install and configure those updates:

    • In SPO Office 365 for enterprises: (

    • In SPO Office 365 for professionals and small businesses: (

  • Thanks.

    I think I have two issues.

    1) The webclient service was set to manual startup.   Making this automatic fixed that.

    2) The 7 hour timeout part you mention is probably what remains for me.  This would appear to rule out running a script during logon, which is a real pain.

    This all worked fine in BPOS.

    In SharePoint I have a document store that contains a number of office templates.  I want to make sure each PC has a up to date local copy of these at each logon.  If a lgon script is not going to work, how else can I achieve this?


  • Hi mrs4m,

    To keep the SharePoint Online (SPO) security token active for more than 7 hours I would recommend using the Keep me signed in option.  I do not know what shutting down the computer at night would do to that token.  If your SharePoint Online keeps logging you off, I would check how IE is handling your cache.

    1. Go to Internet explorer and select Tools -> Internet Options -> General (tab)
    2. Select Settings -> and under Temporary Internet Files select Automatically

    That will help hold your current SPO security token, but is not a replacement for selecting the option Keep me signed in.

    Your web client service should be set to automatic.

  • Test this morning show the token does indeed survive a shutdown.

    So it seems my issue is the 7 hour time windows.   This is not sufficient for a login script, as the machine will typically be turned off overnight.

    I guess I'll replace the login script with an end-of-day scheduled task, so assume the token is avaiable.

    Apart from just trying the "net use", is there any way to test for the presence of the token?

  • Hi ColinR,

    This is Jonis from Microsoft Online SharePoint Support.

    I like the idea of a scheduled task that will run at the end of day for the selected users.  That way every morning your users will have up to date office templates.

    I am not sure how you would go about testing for the presence of the token, but if you want to view the authentication security token go to:

    1. In Internet Explorer select Tools -> Internet Options
    2. Under Browsing history select Settings -> View files
    3. In the Name or Internet Address starting column look for the following type of file: Cookie: or Cookie:

    You might want to look into Client Object Model authentication as another option.