Script to install 2 .exe with parameters

I am trying to develop a script to run 2 .exe with parameters. It will be run in silent mode and both also are norestart. I am running into problems. Any suggestions?

First: Share your code, please! (formatted as code using the code tags “PRE”)

Second: Descibe as detailed as possible what you’ve done and what did not work as expected. Please keep in mind: we cannot see your screen and we cannot read your mind. :wink:

A number of options exist, what have you got so far?

Sorry…I meant to supply this.

 

vcredist_x86.exe /q /repair /norestart -wait
vcredist_x64.exe /q /repair /norestart

You wrote you ran in some problems … ???

$exe = ".\vcredist_x86.exe","vcredist_x64.exe"
$argumentlist = "/q /repair /norestart"

foreach ($e in $exe){
    Start-Process -FilePath $e -ArgumentList $argumentlist -Wait
}

Having issues. Here is my script that I modified to add the full path:

$exe = ".\\tutilitynas\tutility\Microsoft\ServicePacksandHotFixes\InstallMedia\SecurityPatches\SQL\vcredist_x86.exe","\\tutilitynas\tutility\Microsoft\ServicePacksandHotFixes\InstallMedia\SecurityPatches\SQL\vcredist_x64.exe" $argumentlist = "/q /repair /norestart"
foreach ($e in $exe){ Start-Process -FilePath $e -ArgumentList $argumentlist -Wait }
This is the ERROR:
Start-Process : This command cannot be run due to the error: The system cannot find the file specified. At line:5 char:5 + Start-Process -FilePath $e -ArgumentList $argumentlist -Wait + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : InvalidOperation: (:) [Start-Process], InvalidOperationException + FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand

Start-Process : This command cannot be run due to the error: The operation was canceled by the user.
At line:5 char:5

  • Start-Process -FilePath $e -ArgumentList $argumentlist -Wait
    
  • ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
    
  • CategoryInfo : InvalidOperation: (:slight_smile: [Start-Process], InvalidOperationException
  • FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand
Also: It doesn't run in /q. I get a prompt when trying to run.
 

Tried this:

 

$Path86 = "\\tutilitynas\tutility\Microsoft\ServicePacksandHotFixes\InstallMedia\SecurityPatches\SQL\vcredist_x86.exe"

$Path64 = “\tutilitynas\tutility\Microsoft\ServicePacksandHotFixes\InstallMedia\SecurityPatches\SQL\vcredist_x64.exe”

$ArguementList ="/q /repair /norestart"

Start-Process -filepath $Path86 -ArgumentList $ArguementList -wait

Start-Process -filepath $Path64 -ArgumentList $ArguementList

When I run it, the first one seems to run fine but the Path64 doesn't install with the /q parameter. I can't figure out why.