Bypassing 'OK' dialog box

Tagged: 

This topic contains 1 reply, has 2 voices, and was last updated by Profile photo of Don Jones Don Jones 3 years, 2 months ago.

  • Author
    Posts
  • #14640
    Profile photo of Eric Salamone
    Eric Salamone
    Participant

    I am writing a Powershell script to run a few process automatically, but the last .exe ends with an 'OK' dialog box and will not move on to the next command to restart the box until it is acknowledged. I was hoping that maybe if I tried '-WarningAction Continue' common parameters hoping it would acknowledge it, but it didn't. I was wondering if anybody knows a way for it to automatically acknowledge itself, just bypass it after it completes, or should i use something other than 'start-process' cmdlet?

    The end of my script where the dialog box pops up.

    start-process program.exe -wait
    restart-computer -force

  • #14646
    Profile photo of Don Jones
    Don Jones
    Keymaster

    External commands, like exes, don't support common parameters. If that command is coded to display a dialog box, there's probably no way around it. It depends entirely on "program.exe" – this isn't, unfortunately, a PowerShell thing.

You must be logged in to reply to this topic.