detect error message and restart process

Hello,

I have an application that is crashing when my Internet connection is interrupted or disconnected. The application does not exit it shows an error on the screen. The user must acknowledge the error, twice, before the process will exit.

I have a simple script to monitor the process and restart when the process exits. My problem is the errors must be acknowledged before the process exits. How can I automate my script to detect the error message and terminate the process?

I can find no events in the application logs to trigger my action.

I appreciate any pointers you can provide.

Tim,
Welcome to the forum. :wave:t4:

That’s actually not a PowerShell issue in my opinion. And you should urgently contact the vendor or creator of the application and ask for a bugfix.

But anyway … when the application does not indicate the crash in any way you’re pretty much out of luck, I think.

1 Like