Script to install 2 .exe with parameters

Welcome Forums General PowerShell Q&A Script to install 2 .exe with parameters

Viewing 7 reply threads
  • Author
    Posts
    • #210153
      Participant
      Topics: 3
      Replies: 5
      Points: 41
      Rank: Member

      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?

    • #210165
      Participant
      Topics: 4
      Replies: 2247
      Points: 5,484
      Helping Hand
      Rank: Community MVP

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

    • #210168
      Participant
      Topics: 6
      Replies: 93
      Points: 427
      Helping Hand
      Rank: Contributor

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

    • #210171
      Participant
      Topics: 3
      Replies: 5
      Points: 41
      Rank: Member

      Sorry…I meant to supply this.

       

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

    • #210177
      Participant
      Topics: 4
      Replies: 2247
      Points: 5,484
      Helping Hand
      Rank: Community MVP

      You wrote you ran in some problems …. ???

    • #210282
      Participant
      Topics: 5
      Replies: 322
      Points: 445
      Helping Hand
      Rank: Contributor
      $exe = ".\vcredist_x86.exe","vcredist_x64.exe"
      $argumentlist = "/q /repair /norestart"
      
      foreach ($e in $exe){
          Start-Process -FilePath $e -ArgumentList $argumentlist -Wait
      }
      
    • #210807
      Participant
      Topics: 3
      Replies: 5
      Points: 41
      Rank: Member
      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.

       

    • #210870
      Participant
      Topics: 3
      Replies: 5
      Points: 41
      Rank: Member

      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.
Viewing 7 reply threads
  • You must be logged in to reply to this topic.