检测应用程序崩溃并重新启动它的最佳方法

检测应用程序崩溃并重新启动它的最佳方法

本文介绍了检测应用程序崩溃并重新启动它的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在 XP 中检测应用程序崩溃的最佳方法是什么(每次都产生相同的错误"窗口对 - 每个窗口标题相同)然后重新启动它?

What's the best way to detect an application crash in XP (produces the same pair of 'error' windows each time - each with same window title) and then restart it?

我对使用最少系统资源的解决方案特别感兴趣,因为所讨论的系统已经很老了.

I'm especially interested to hear of solutions that use minimal system resources as the system in question is quite old.

我曾想过使用像 AutoIt 这样的脚本语言 (http://www.autoitscript.com/autoit3/),并且可能每隔几分钟触发一个检测器"脚本?

I had thought of using a scripting language like AutoIt (http://www.autoitscript.com/autoit3/), and perhaps triggering a 'detector' script every few minutes?

在 Python、Perl、PowerShell 或完全其他的东西中这样做会更好吗?

Would this be better done in Python, Perl, PowerShell or something else entirely?

非常感谢任何想法、提示或想法.

Any ideas, tips, or thoughts much appreciated.

它实际上并没有崩溃(即退出/终止 - 感谢@tialaramex).它显示一个等待用户输入的对话框,然后是另一个等待用户进一步输入的对话框,然后它实际上退出了.我想检测和处理的正是这些对话框.

It doesn't actually crash (i.e. exit/terminate - thanks @tialaramex). It displays a dialog waiting for user input, followed by another dialog waiting for further user input, then it actually exits. It's these dialogs that I'd like to detect and deal with.

推荐答案

如何创建一个包装应用程序,将故障应用程序作为子应用程序启动并等待它?如果子进程的退出代码指示错误,则重新启动它,否则退出.

How about creating a wrapper application that launches the faulty app as a child and waits for it? If the exit code of the child indicates an error, then restart it, else exit.

这篇关于检测应用程序崩溃并重新启动它的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

08-21 17:47