# Script to install 2 .exe with parameters

**URL:** <https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959>\
**Category:** PowerShell Help\
**Created:** [March 13, 2020, 9:31am UTC](https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959 "2020-03-13T09:31:06Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![csmitchell007](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@csmitchell007](https://forums.powershell.org/u/csmitchell007)\
**Post date:** [March 13, 2020, 9:31am UTC](https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959/1 "2020-03-13T09:31:06Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [March 13, 2020, 9:37am UTC](https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959/2 "2020-03-13T09:37:18Z")

</div>

> [@](#):
>
> Any suggestions?

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

> [@](#):
>
> I am running into problems.

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. 😉

---

<div class="post-metadata">

**Author:** ![tonyd](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/tonyd/32/1041_2.png) [@tonyd](https://forums.powershell.org/u/tonyd)\
**Post date:** [March 13, 2020, 9:37am UTC](https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959/3 "2020-03-13T09:37:36Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![csmitchell007](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@csmitchell007](https://forums.powershell.org/u/csmitchell007)\
**Post date:** [March 13, 2020, 9:39am UTC](https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959/4 "2020-03-13T09:39:50Z")

</div>

Sorry…I meant to supply this.

&nbsp;

vcredist\_x86.exe /q /repair /norestart -wait  
vcredist\_x64.exe /q /repair /norestart

---

<div class="post-metadata">

**Author:** ![Olaf](https://sea1.discourse-cdn.com/flex019/user_avatar/forums.powershell.org/olaf/32/992_2.png) [@Olaf](https://forums.powershell.org/u/Olaf)\
**Post date:** [March 13, 2020, 9:45am UTC](https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959/5 "2020-03-13T09:45:16Z")

</div>

You wrote you ran in some problems … ???

---

<div class="post-metadata">

**Author:** ![random-commandline](https://avatars.discourse-cdn.com/v4/letter/r/e56c9b/32.png) [@random-commandline](https://forums.powershell.org/u/random-commandline)\
**Post date:** [March 14, 2020, 6:43am UTC](https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959/6 "2020-03-14T06:43:40Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![csmitchell007](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@csmitchell007](https://forums.powershell.org/u/csmitchell007)\
**Post date:** [March 17, 2020, 8:28am UTC](https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959/7 "2020-03-17T08:28:26Z")

</div>

> [@](#):
>
> PowerShell
> 
> 7 lines
> 
> \<textarea class="ace\_text-input" style="left: 44px; top: 0px; width: 6.6px; height: 18px; opacity: 0;" spellcheck="false" wrap="off"\>\</textarea\>
> 
> 1
> 
> 2
> 
> 3
> 
> 4
> 
> 5
> 
> 6
> 
> 7
> 
> $exe = ".\vcredist\_x86.exe","vcredist\_x64.exe"
> 
> $argumentlist = "/q /repair /norestart"
> 
> foreach ($e in $exe){
> 
> Start-Process -FilePath $e -ArgumentList $argumentlist -Wait
> 
> }
> 
> XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

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: (🙂 [Start-Process], InvalidOperationException
- FullyQualifiedErrorId : InvalidOperationException,Microsoft.PowerShell.Commands.StartProcessCommand  

Also: It doesn't run in /q. I get a prompt when trying to run.
&nbsp;

---

<div class="post-metadata">

**Author:** ![csmitchell007](https://avatars.discourse-cdn.com/v4/letter/c/74df32/32.png) [@csmitchell007](https://forums.powershell.org/u/csmitchell007)\
**Post date:** [March 17, 2020, 12:32pm UTC](https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959/8 "2020-03-17T12:32:39Z")

</div>

Tried this:

&nbsp;

```
$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.

---

<div class="post-metadata">

**Author:** ![dotnVo](https://avatars.discourse-cdn.com/v4/letter/d/4af34b/32.png) [@dotnVo](https://forums.powershell.org/u/dotnVo)\
**Post date:** [May 16, 2024, 8:30pm UTC](https://forums.powershell.org/t/script-to-install-2-exe-with-parameters/13959/9 "2024-05-16T20:30:15Z")

</div>

Closed on May 16, 2024, 8:30pm UTC


