How to run an MSI install as admin with VBscript

Anything VBScript-related, including Windows Script Host, WMI, ADSI, and more.
Forum rules
Do not post any licensing information in this forum.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 12 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked
User avatar
galbanis
Posts: 2
Last visit: Mon Jan 30, 2012 4:26 am

How to run an MSI install as admin with VBscript

Post by galbanis »

Hello...just wondering if anyone can assist with the following: set WshShell = CreateObject("WScript.Shell") WshShell.Run "runas /user:administrator ""msoidcli.msi""" WScript.Sleep 300 WshShell.Sendkeys "xxxxxx~" Now the problem I'm having is sticking the "msiexec /i" command in there. If I do this: WshShell.Run"runas /user:administrator ""msiexec /i msoidcli.msi""" It does not see the /i switch and the installer package. I also tried a set command and doing a runas on a variable but I get the same results....
User avatar
galbanis
Posts: 2
Last visit: Mon Jan 30, 2012 4:26 am

How to run an MSI install as admin with VBscript

Post by galbanis »

Hello...just wondering if anyone can assist with the following: set WshShell = CreateObject("WScript.Shell") WshShell.Run "runas /user:administrator ""msoidcli.msi""" WScript.Sleep 300 WshShell.Sendkeys "xxxxxx~" Now the problem I'm having is sticking the "msiexec /i" command in there. If I do this: WshShell.Run"runas /user:administrator ""msiexec /i msoidcli.msi""" It does not see the /i switch and the installer package. I also tried a set command and doing a runas on a variable but I get the same results....
jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

How to run an MSI install as admin with VBscript

Post by jvierra »

In this situation SendKeys will not work.

You would be better off running the MSI directly.
WshShell.Run"runas /user:administrator msoidcli.msi"
MSI files are automated and the runas should find the MSIEXEC program automatically.

You cannot use RunAs to elevate a command. You will still get a UAC prompt.

MSI files are easier to install via Group Policy.

jvierra
Posts: 15439
Last visit: Tue Nov 21, 2023 6:37 pm
Answers: 30
Has voted: 4 times
Been upvoted: 33 times

How to run an MSI install as admin with VBscript

Post by jvierra »

Warniung - pasword crackers can decryupt passwords stored using the basic encryption scheme of WIndows.


What you are rdoing is one thing web malware look for. It is so easy to do that it is a joke.

I have a disk that can decrypt a password encrypted with the basic password encryption in a users account in a second.

Consider using a remote install. WMI can do this admistratively even in a workgroup.

This topic is 12 years and 2 months old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
Locked