Windows Client TechCenter >
Windows 7 Forums
>
Windows 7 Networking
>
Mapped Drives Unavailable via Escalated Command Prompt?
Mapped Drives Unavailable via Escalated Command Prompt?
- 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 NetworkOK P: \\MEDIA-SERVER\Share Microsoft Windows NetworkIf 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 NetworkUnavailable P: \\MEDIA-SERVER\Share Microsoft Windows NetworkIs 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
- 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- Marked As Answer byNicholas LiMSFT, ModeratorTuesday, November 10, 2009 8:00 AM
All Replies
- 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- Marked As Answer byNicholas LiMSFT, ModeratorTuesday, November 10, 2009 8:00 AM

