Installing MSI Packages with Elevated Privileges

by Mitch Tulloch [Published on 18 Jan. 2006 / Last Updated on 18 Jan. 2006]

Want to right-click on a .msi file and select Run As? Here's how!

RunAs is a great way of temporarily elevating your privileges to admin level when you are logged on as an ordinary user. However, while you can right-click on .exe files and select Run As from the shortcut menu, this doesn't work with Windows Installer (.msi) packages.

Here's a workaround that makes this possible. Open Registry Editor as administrator and create the following key under HKCR\Msi.Package\shell:

   HKCR\Msi.Package\shell\runas

Now set the default value of this key to the following:

   Install &as...

Now create the following subkey:

   HKCR\Msi.Package\shell\runas\command

Set the default value of this subkey to the following:

   msiexec /i "%1"

Now you should be able to right-click on a .msi file and select Install As from the shortcut menu.

Cheers,
Mitch Tulloch
www.mtit.com/mitch/

See Also

Featured Links