Reliable killing of Windows programs stuck in problem reports,

I am looking for a way to kill an exe program for Windows, which when testing with a python script crashes and presents a dialog to the user; since this program is called many times, and can run multiple times, this is not suitable.

The problem dialog is a standard Windows error reporting:

"Foo.exe has encountered a problem and needs to close. We are sorry for the inconvenience

and offers buttons for debugging, sending error messages and buttons "Do not send."

I can kill other forms of dialogue that result from crashes (for example, the dialog of rejecting the debug report is okay.)

I tried to execute taskkill.exe, pskill and the terminate () function of the Popen object from the subprocess module that was used to call .exe

Has anyone encountered this particular problem and found a solution?

I expect automation of user input to select a window, and click the "Do not send" button - this is one of the possible solutions, but I would like to do something much simpler

+3
source share
2 answers

Wouldn't it be easier to disable the error reporting feature?

+3
source

If you must use CreateProcessEx or a special WinAPI function, you can call TerminateProcess or TerminateThread to force the process to terminate.

0

Source: https://habr.com/ru/post/1748025/


All Articles