How to Run a .MSI File as Administrator

When Microsoft released Windows 7 a few years ago, it removed the ability to run a .msi file as an administrator when you right-click on it.

From the outset, what may seem like a small insignificant problem, turns out to be quite a nuisance if you are a support technician and you have a computer captured with some application such as VNC or Teamviewer and you need to run a .msi file as a remote administrator. How to do it without losing the connection or without logging in with a user with administrator permissions?

Well, to be able to run a .MSI file as an administrator in a user session with standard permissions, there are two alternatives:

  • Run the .msi as an administrator using commands from a command prompt window.
  • Modify the registry so that the option to run as administrator appears when right-clicking on a .msi file.

In the past, Microsoft also released a plugin for Windows that enabled the “run as administrator” option when right-clicking on the MSI file. However, this tool is no longer available, so you have no choice but to use a simple MS-DOS command. Let’s see how it works.

Method #1: Run MSI from Command Console

Go to C:\Windows\System32 and locate the cmd.exe file. Right-click (press “shift” while clicking if you want to run with another user) on the file and choose “Run as administrator.

Once the terminal console is open, type the following command:

msiexec -i C:\filepath\filename.msi

Example:

msiexec -i C:\users\android\Desktop\test.msi

run a .msi file on command prompt

Note: Remember that if the file is in the same path in the terminal window, you don’t need to type the full path of the file. That is, in such a case, simply write the name of the file (“test.msi” or whatever) and press enter to run it.

Note that if there are blank spaces inside the path, you have to put the path in quotes » » for the system to recognize it. In the example, above we have also assumed that the file is on the (C:) drive, but if the file is located on another drive you must specify that drive (either (D:), (E:), or wherever you have saved the .msi file).

Windows 10 and Windows 11

If you’re working from a Windows 10 or Windows 11 PC, you can also open a terminal window with administrator permissions by doing the following:

  • Right-click on the Windows Start button and select “ Windows Powershell (Admin) ”.

Windows 7

In Windows 7, you can also open a terminal window with administrator permissions by clicking on the Windows search box and typing “cmd”. In the results select “Run as administrator”.

Method #2: How to Modify the Registry to Run .msi Files as Administrator

This other method is much more delicate since it requires you to modify the Windows registry, which can lead to a serious system problem if any error or human error occurs. The positive part is that you will make a global change that will enable the “Run as administrator” option when you right-click on any .MSI file on your PC.

  • Press the key combination WIN+R and execute the command « regedit «.
  • In Registry Editor, navigate in the left menu to the path: HKEY_CLASSES_ROOT\Msi.Package\shell.
  • Right-click on the “shell” folder and create a new key called ” runas “.
  • Now right click on the new “runas” folder you just created and generate a new key called ” command “.
  • Enter the “command” folder and double click on the Default parameter to change the value information to “ C:\Windows\System32\msiexec.exe /a \”%1\” %* ” (without quotes).HKEY registry editor

After doing this, restart the PC. From this point on, Windows should start showing the option to run MSI files as administrator.

More Like This

Remove Pre-Installed Programs in Windows with PowerShell

Bloatware is a term used to refer to all those “filler” programs that are not essential and that usually appear in your operating system only...

Windows 10 Doesn’t Recognize Your Android Phone? Solution!

The integration between Windows and Android is becoming more and more noticeable. You can now make calls from the PC if you synchronize it with...

How to Remove a Service in Windows

Windows services are programs that run in the background without user interaction. Most of these services are necessary for the correct functioning of the operating system...