Resources for IT Professionals > Forums Home > Windows 7 IT Pro Forums > Windows 7 Networking > Mapped Drives Unavailable via Escalated Command Prompt?

Answered Mapped Drives Unavailable via Escalated Command Prompt?

  • Saturday, November 07, 2009 4:47 AM
     
     
    I have two drives mapped to my media server (\\media-server\share and \\media-server\media) as P: and M: respectively. I can access the drives from my normal account (matt-pc\matt) fine, both via Explorer and the Command Prompt. 

    A net use shows the following:

    Status       Local     Remote                    Network

    -------------------------------------------------------------------------------
    OK           M:        \\media-server\Media      Microsoft Windows Network
    OK           P:        \\MEDIA-SERVER\Share      Microsoft Windows Network


    If I open an escalated command prompt (open cmd as administrator) I cannot access the drives by changing to their drive letter and a net use shows this:

    Status       Local     Remote                    Network

    -------------------------------------------------------------------------------
    Unavailable  M:        \\media-server\Media      Microsoft Windows Network
    Unavailable  P:        \\MEDIA-SERVER\Share      Microsoft Windows Network

    Is this by design, or is it perhaps a bug? A whoami in either command prompt shows matt-pc\matt as the user account. I have asked someone else to verify this behavior and they noted the same thing. (http://www.dslreports.com/forum/r23304435-WIN7-Network-Share-Bug)

Answers

All Replies

  • Saturday, November 07, 2009 5:34 PM
     
     Answered
    The problem occurs because of the way administrator accounts work in Vista and Windows 7. When you logon with an administrator account the account gets two tokens, a standard user token and an administrator token. When you originally mapped the drive the standard user token was used. In an elevated command prompt the administrator token is used. The mapped drive is outside of the context of the administrator token. I hope that made sense. The best work around is to use UNC drive paths or remap the drive in the elevated command prompt. Here is another workaround. Note that it is not recommended. I have not tested it in Windows 7. The article is about Vista.

    http://support.microsoft.com/kb/937624

    This search may help

    http://www.bing.com/search?q=vista+mapped+drives+administrator+token&go=&form=QBRE&filt=all&qs=n


    Kerry Brown MS-MVP - Windows Desktop Experience
  • Tuesday, March 15, 2011 3:39 AM
     
      Has Code

    Anything new found on this issue? 

    I understand the logic in the explanation, but it seems like Microsoft should have come up with a workaround that is "safe" by now.

    Just an FYI for anyone wanting to use the suggested workaround of remapping the drives from within the elevated command console. If the drive you are trying to access is Z: use the following command in the elevated command prompt to remap it.

    net use z: /d
    
    net use z: \\server\share

     

  • Wednesday, May 04, 2011 1:25 PM
     
     
    Thanks guys, the net use commands combined with the cmd prompt as admin (start, cmd, ctrl + shift + enter) solved the problem for me.