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

How to Disable User Account Control (UAC) in Windows

The User Account Control or UAC is a Windows tool that lets you control applications that attempt to make changes in the team. It is the cause of the famous “Do...

How to Change Windows RDP Password?

We all know very well that sometimes following security best practices is not enough and practical. But still, we must follow security guidelines to maintain...

How to Open an HTML (HTM) File on Windows and macOS

Have you downloaded a file with the .HTM extension and don't know how to open it? If it happened, you are in the right place. I will explain...