Author Posts

August 19, 2017 at 10:58 am

Hi im trying to work on a power-shell scripted that will run at start up i have got it working but when it installs ninite.exe it stops as you need user interaction to close after it finishes the install

could come one help me with a command line to wait till Ninite.exe installs and then closes the installer so that it carry's on with the steps.

# This starts the office install which doesnt need to be a part of the other command
$p = New-Object System.Diagnostics.Process
$pinfo = New-Object System.Diagnostics.ProcessStartInfo("C:\Install_File\Office.exe","");
$p.StartInfo = $pinfo;
$p.Start();
$p.WaitForExit();
Write-Host "end of ps1" + (Get-Date).DateTime


# This starts Ninite and waits for it to be closed to carry on the script
$p = New-Object System.Diagnostics.Process
$pinfo = New-Object System.Diagnostics.ProcessStartInfo("C:\Install_File\Ninite.exe","");
$p.StartInfo = $pinfo;
$p.Start();
$p.WaitForExit();
ControlClick("Ninite", "", "[ID:2]")
Write-Host "end of ps1" + (Get-Date).DateTime

# This deletes all the files
# Remove-Item c:\Ninite.exe
# Remove-Item c:\Office.exe
Remove-Item C:\Install_File -Recurse

August 19, 2017 at 10:30 pm

Looks like Ninite has a "silent" mode you can enable. That should solve this problem for you.

https://ninite.com/help/features/silent.html