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 Mitch Tulloch.
  • Rated 4.5 out of 5 based on 65 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 Mitch Tulloch

Mitch Tulloch is a widely recognized expert on Windows administration, networking, and security. He has been repeatedly awarded Most Valuable Professional (MVP) status by Microsoft for his outstanding contributions in supporting users who deploy and use Microsoft platforms, products and solutions. Mitch has published over two hundred articles on different IT websites and magazines, and he has written or contributed to almost two dozen books and is lead author for the Windows 7 Resource Kit from Microsoft Press. For more information, see www.mtit.com .


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 network administration tool?