Click here to Skip to main content
15,887,135 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
I am new to power shell, I want to install .msi for this we are using below command,
Start-Process msiexec.exe -Wait -ArgumentList 'C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi'

However this is giving me an error. Along with this it should automatically accept next button.

Even I tried this also
Start-Process msiexec.exe -Wait -ArgumentList '"C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi"', '/i', '/q'

Please help me for the same.


What I have tried:

Start-Process msiexec.exe -Wait -ArgumentList 'C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi'


Start-Process msiexec.exe -Wait -ArgumentList '"C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi"', '/i', '/q'
Posted
Updated 15-Mar-20 23:50pm
Comments
Richard Deeming 12-Mar-20 8:11am    
If you want someone to help you fix an error, then you need to tell us what the error is.
pady1002 16-Mar-20 2:19am    
It only pop up a msg of Windows Install with all default values like Windows ® Installer. V 5.0.18362.1

msiexec /Option <required parameter=""> [Optional Parameter]

Install Options
pady1002 13-Mar-20 6:18am    
It only pop up a msg of Windows Install with all default values like Windows ® Installer. V 5.0.18362.1

msiexec /Option <required parameter=""> [Optional Parameter]

Install Options
ZurdoDev 13-Mar-20 9:59am    
Reply to the comment so that the user is notified.

And when you have additional information, click on Improve question and edit your question.

1 solution

Looking at the documentation[^], the ArgumentList needs to be a single string.

You also need to put the /i before the package name:
Command-Line Options - Win32 apps | Microsoft Docs[^]
PowerShell
Start-Process msiexec.exe -Wait -ArgumentList '/i "C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi" /q'
 
Share this answer
 
Comments
pady1002 16-Mar-20 7:10am    
I tired above code, command gets executed , however fire fox does not get installed. I am using windows 10 and below is powershell version
Major Minor Build Revision
----- ----- ----- --------
5 1 18362 628
Richard Deeming 16-Mar-20 14:58pm    
Try logging the output from the MSI file to see if there is any useful information:
Start-Process msiexec.exe -Wait -ArgumentList '/i "C:\Users\abc.xuz\Downloads\Firefox Setup 14.0.1.msi" /q /le "C:\Users\abc.xuz\Downloads\Firefox.log"'

NB: You're attempting to install an extremely old version of Firefox, which is no longer supported and has a lot of critical security vulnerabilities. You should be using either the latest version (74.0) or the latest ESR version (68.6).
Download the Firefox Browser in English (US) and more than 90 other languages[^]
pady1002 18-Mar-20 2:29am    
Thanks reachard.
However if the same we want to do for any .exe file, how can we achieve it.
Please hel me for the same...
Richard Deeming 18-Mar-20 5:39am    
You pass the exe file as the first argument to Start-Process, and the relevant arguments in the -ArgumentList.

I can't tell you what those arguments are, because they will be different for every application.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900