Bypassing 'OK' dialog box

Welcome Forums General PowerShell Q&A Bypassing 'OK' dialog box

This topic contains 1 reply, has 2 voices, and was last updated by

 
Keymaster
4 years, 6 months ago.

  • Author
    Posts
  • #14640

    Participant
    Points: 0
    Rank: Member

    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

    Keymaster
    Points: 1,619
    Helping HandTeam Member
    Rank: Community Hero

    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.

The topic ‘Bypassing 'OK' dialog box’ is closed to new replies.