Installing MSI Packages with Elevated Privileges

  • Section(s): Command shell, Security
  • Published on Jan 18, 2006.
  • Last Modified on Jan 18, 2006.
  • Last Modified by MitchTulloch.
  • Rated 4.5 out of 5 based on 42 votes.
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/

About MitchTulloch

Mitch Tulloch was lead author for the Windows Vista Resource Kit from Microsoft Press, which is the book for IT pros who want to deploy, maintain and support Windows Vista in mid- and large-sized network environments. Mitch was also the author of Introducing Windows Server 2008 and technical project lead for the Microsoft Office Communications Server 2007 Resource Kit, both books also from Microsoft Press. For more information on these and other books by Mitch, see www.mtit.com .

Share this article


Article not looking right or info is missing? Let us know so that we can fix it: .


Receive all the latest articles by email!

Receive Real-Time & Monthly WindowsNetworking.com article updates in your mailbox. Enter your email below!
Click for Real-Time sample & Monthly sample

Become a WindowsNetworking.com member!

Discuss your network issues with thousands of other network administrators. Click here to join!

Community Area

Log in | Register

Readers' Choice

Which is your preferred Firewall & VPN hardware solution?