up vote 6 down vote favorite
1
share [g+] share [fb]

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?

link|improve this question

feedback

protected by studiohack May 3 '11 at 10:11

This question is protected to prevent "thanks!", "me too!", or spam answers by new users. To answer it, you must have earned at least 10 reputation on this site.

3 Answers

up vote 11 down vote accepted

.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>"
link|improve this answer
related: serverfault.com/questions/19341/… – hyperslug Aug 13 '09 at 9:11
Ah thanks, hadn't checked serverfault. @fretje: Thanks, however I first got an error message that msiexec couldn't open the msi file. It appears that you need to specify the entire path to the msi file. The current directory that runas is run from doesn't get passed to the command that is being run, in this case msiexec (which makes sense). – Tim Pietzcker Aug 13 '09 at 9:32
@Tim: Ok, thanks, updated the answer. – fretje Aug 13 '09 at 9:36
It looks like you should also be able to just use msiexec /a package.msi -- see the msiexec page on TechNet (which says it's for Server 2003, but appears identical to the content of the corresponding page in the XP help system). – SamB Dec 10 '10 at 22:39
@SamB: Administrative installation merely means installing an image of an installsource local on the network from where others then can install the application on their machine (in stead of using a cd-rom). The user can then choose to run-from-source when he installs and the installer uses most of the product's files directly from the network. So this is not what the OP means (run as administrator). – fretje May 19 '11 at 7:11
show 1 more comment
feedback

You can always open a command prompt as an administrator (either right-click runas or start->run->runas /user:administrator cmd), change to the directory where your MSI exists, and execute msiexec /i product.msi

Or add this to your register: HKEY_CLASSES_ROOT\Msi.Package\shell\runas\command Values: Install &as... HKEY_CLASSES_ROOT\Msi.Package\shell\runas\command Value: msiexec /i "%1"

link|improve this answer
feedback

Take a look at runas from the command line. You can launch anything under as specified account.

link|improve this answer
feedback

Not the answer you're looking for? Browse other questions tagged or ask your own question.