Welcome to the QA Tech-Tips blog!

Some see things as they are, and ask "Why?"   I dream things that never were, and ask "Why Not".  
Robert F. Kennedy

“Impossible” is only found in the dictionary of a fool.  
Old Chinese Proverb

Friday, November 4, 2011

You Can't Get There From Here!
Mapped drives are not visible from an
elevated command prompt


This is another one of those "What WERE they smoking?" type of tech-tips.

Issue:
You are using either Vista (ye Gods!) or Win-7.
You have one or more mapped drives to external/networked resources.
You open an elevated command prompt and attempt to do something that requires access to the mapped drive.

Zzzzzzzzt!  "We're sorry, but thanks for playing!"

You will notice, rather rapidly, that "you can't get there from here" - that is, the command prompt window cannot see any of your mapped drive letters.  To be brutally honest about it, the command window CAN see the mapped letters. . . . it just won't let YOU have them!

(Note that there are reports from people saying that this won't work from a non-elevated command prompt too, but others claim that this is not an issue.  Your Mileage May Vary.)

If you search the Web you will see a mighty wailing and gnashing of teeth, with people waiting in line to beat Microsoft senseless over this issue.

There are two workarounds for this issue - though, in my opinion, these are UGLY hacks for a lack of functionality that should exist by default.

  • From an elevated command prompt, execute:
    net use [letter:] \\[system]\[share]
    Note that you cannot use the pre-existing mapped drive letter.  The command prompt won't let you use it by default, but complains if you try to map it within the command window.  Go figure!
    (Ref: http://tinyurl.com/6xlk664 - near the bottom of the page)

  • You can edit a Registry key:
    HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System
    by creating the a DWORD value of EnableLinkedConnections and setting it to "1"
    Though this works, sources at Microsoft claim that it opens potential security holes to cleverly written malware.
    (Ref: http://tinyurl.com/5sunjbb)

For those of you who are more paranoid about security, or if you want to write batch-files that are portable, I would suggest the first solution.  Otherwise, you can make the registry edit and take your chances.

To read all about it, along with Microsoft's response, here's the referenced article, http://tinyurl.com/5sunjbb
that discusses this issue in detail.

Sigh. . . .  You're damned if you do, and damned if you don't.

What say ye?

Jim (JR)

No comments:

Post a Comment

Thanks for sharing your thoughts here at the QA Tech-Tips Blog!

Note:
This blog will not, repeat NOT, publish comments that contain ANY KIND OF HYPERLINK.

If your comment contains ANY KIND OF HYPERLINK it WILL BE DELETED.

Please read the article at How To Get Comments Approved On This Blog for additional information regarding this rule.

Thank you for understanding.

Jim (JR)