Reputation: 455
I would like to know how to install something, anything, such as notepad with powershell unattended. i really cant find much on this online. I renamed the exe file to notepad.exe and threw it on the root of c. this doesnt work but its what I got: Start-Process c:\notepad.exe -ArgumentList "/q" -Wait
I cant get anything from the powershell help. this still makes me have to accept and click through the install process, im trying to avoid that. any help and educating me too would be greatly appreciated
Upvotes: 0
Views: 2103
Reputation: 25
you can install a program in silent mode with a vbs script :
Here is an example :
Option Explicit Dim MaCmd MaCmd = "Start /Wait D:\Soft\file.exe /S"&_ " & echo Soft was fully installed > LogInstall.txt & Start LogInstall.txt" Call Executer(MaCmd,0) '************************************************************************************************** Function Executer(StrCmd,Console) Dim ws,MyCmd,Resultat Set ws = CreateObject("wscript.Shell") 'Value 0 for hide Ms-Dos If Console = 0 Then MyCmd = "CMD /C " & StrCmd & " " Resultat = ws.run(MyCmd,Console,True) If Resultat = 0 Then 'MsgBox "Success" Else MsgBox "an unknown error occurred" End If End If 'Value 1 for show MS-Dos If Console = 1 Then MyCmd = "CMD /K " & StrCmd & " " Resultat = ws.run(MyCmd,Console,False) If Resultat = 0 Then 'MsgBox "Success" Else MsgBox "an unknown error occurred" End If End If Executer = Resultat End Function '****************************************************************************************************
Upvotes: 0
Reputation: 11
If you run the install program with /? as a switch, it shows you the answer - either /passive for an unattended install, or /q for a silent install.
Upvotes: 1
Reputation: 15824
That totally depends on the installer you're trying to use. Unfortunately, Windows installers aren't all .msi packages, and the executables all have different switches.
You could check out Chocolatey, which certainly has loads of silent install scripts for installing apps (and everything's done with PowerShell scripts), including packages for Notepad++ and Notepad2, etc.
Upvotes: 0