How to disable error report dialogs in Windows

Last edited on

Overview

By default Windows reports most program crashes in a dialog. When this happens, execution is halted until the dialog is closed by the user.

This behavior is undesirable for automatic testing since if an AUT crashes, execution of the current test case — and all subsequent ones — will be blocked.

How to disable error reporting in Windows XP

In Windows XP the error reporting dialog is displayed by the “Windows Error Reporting Service” (ERSvc) service. You can start, stop and configure the service in My Computer→Manage→Services, and you can start or stop it with Window’s net command line tool:

net stop ERSvc

To start it again:

net start ERSvc

How to disable error reporting in Windows Vista and higher

In Windows Vista (and higher) the error reporting dialog is displayed by the “Windows Error Reporting Service” (WerSvc) service. You can start, stop and configure the service in My Computer→Manage→Services, and you can start or stop it with Window’s net command line tool:

net stop WerSvc

To start it again:

net start WerSvc

Starting and stopping this service requires elevated access rights on Windows Vista.

How to close crash dialogs automatically

If crash dialogs still appear (for example, ones from the application itself rather than Windows), or if access elevation is not available on Vista, the problem can be worked around by using an AutoHotkey script:

#SingleInstance force
#Persistent

SetTimer, CloseWindowsCrashPopup, 1000 ; every second

CloseWindowsCrashPopup:
    SetTitleMatchMode 1
    IfWinExist, Microsoft Windows
    {
        WinClose
    }

    Process Close, WerFault.exe
return
CloseWindowsCrashPopup.ahk

(You can download the above script as a standalone .exe file CloseWindowsCrashPopup-1.1.zip .)

Windows Error Reporting Settings