Windows – Run MSI files as administrator from a user account

privilegeswindows xpwindows-installer

I'm usually logged in as a normal user on my Windows XP box. Sometimes, when I want to install a software update, I don't want to log off and log on again as admin, but I right-click the installer exe and choose "Run as…" to run it from my admin account. However, this option only seems to exist for exe files, not for msi files.

Is there a way to make msi files run under a different account? Or is that not advisable for some reason?

Best Answer

.msi files can be executed with msiexec.exe, so in combination with the runas command, you could accomplish what your want:

runas /user:administrator "msiexec /i <path and filename of your msi>"

As a full-path to the file is recommended, it might need quotes around it and you need to escape them then with a backslash \:

runas /user:administrator "msiexec /i \"<path and filename of your msi>\""
                                      ^^                               ^^