Поделиться через


Avoiding UAC prompt starting Hyper-V Manager

An interesting question was posed to me a couple of days back about why when starting Hyper-V Manager, you get a UAC prompt, yet you don't with most other Microsoft Administrative MMCs. You should note that the workaround in here only applies to Windows 7/Windows Server 2008 R2, and is not a supported workaround.

This post has more information about what changed in UAC in Windows 7 & R2. Unfortunately, the simple fact of time and the team learning of the change too late meant that we shipped Hyper-V the same as in Vista/2008 by placing virtmgmt.msc, in \program files\Hyper-V. As that location is not, in Marks terminology, a "secure location", or at least not one known about by MMC, you get the elevation prompt when starting Hyper-V Manager.

The workaround is a simple one.

First, from an elevated command prompt, copy \program files\Hyper-V\virtmgmt.msc to \windows\system32.

elevation1

Next, open the properties for the shortcut to Hyper-V Manager located under Administrative Tools. The target will be %windir%\system32\mmc.exe "%ProgramFiles%\Hyper-V\virtmgmt.msc" . Update this to %windir%\system32\mmc.exe %windir%\system32\virtmgmt.msc. Do not change the "Start in" location though.

From
elevation2

To
elevation3

Note that double quotes are not necessary. When you hit enter, you will get a UAC prompt to confirm the update.

elevation4

And that's it - starting Hyper-V Manager should no longer prompt you for elevation.
Cheers,
John.

Comments

  • Anonymous
    January 01, 2003
    Thanks for this trick. Peter

  • Anonymous
    July 16, 2010
    Thanks, John. That's a really useful little trick.

  • Anonymous
    April 12, 2011
    This is perfect - Thank you.