开发者

How do I suppress the "notify Microsoft" crash dialogs when I call a command from Perl?

I am calling a command-line program from my Perl script. When these programs crash, I am prompted with a messagebox asking me if I want to notify Microsoft. Since this is an automated system it would be desirable if I could suppress that message and contin开发者_StackOverflow中文版ue with other things in my script. Is this possible?


You probably could use the WerAddExcludedApplication function to stop WER from kicking in when the program crashes. You should revert hat exclusion afterwards again with WerRemoveExcludedApplication.


A little more info on how to switch off error reporting

  • In XP and server 2003 http://www.windowsnetworking.com/articles_tutorials/Disable-Error-Reporting-Windows-XP-Server-2003.html

  • in vista http://chris.pirillo.com/how-to-disable-windows-error-reporting/


Enabling this group policy under Windows Error Reporting (WER) should do the trick (testing right now because I have the same problem): https://www.raymond.cc/blog/disable-program-has-stopped-working-error-dialog-in-windows-server-2008/

no popup will be raised in case you execute a program and it chrashes inside your system() call in your perl script. But be aware that the policy will be system wide; no problem though if your system is used for batch jobs.


The problem doesn't sound like its a Perl problem, it sounds like an issue with the system commands. Which do you mean by "when these programs crash". Your system programs?

It depends on what is causing the crash. This is the "Dr. Watson" error / WinQUAL feature and it really should not happen for pure Perl code, if it does, it means the Perl interpreter is crashing and you have a Perl bug or are using a native extension that is crashing, make sure you have the latest stable build of either Perl or any native extensions. Narrow it down to what is crashing.

You can also turn off the Windows Error Reporting feature altogether, from the Windows control panel.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜