Windows Client TechCenter > Windows 7 Forums > Windows 7 Networking > Mapped Drives Unavailable via Escalated Command Prompt?
Ask a questionAsk a question
 

AnswerMapped Drives Unavailable via Escalated Command Prompt?

  • Saturday, November 07, 2009 4:47 AMmevans336 Users MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     
    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

  • Saturday, November 07, 2009 5:34 PMKerry_BrownMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    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

All Replies

  • Saturday, November 07, 2009 5:34 PMKerry_BrownMVPUsers MedalsUsers MedalsUsers MedalsUsers MedalsUsers Medals
     Answer
    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