The registry way
There's no way like the registry way.
Open an elevated command prompt.
Type or paste the following command, and press Enter:
reg add "HKLM\SOFTWARE\Policies\Microsoft\Windows\Windows Error Reporting" /v "DontShowUI" /t REG_DWORD /d 1 /f
There is also a related, per-user
DontShowUI value stored in
HKCU\Software\Microsoft\Windows\Windows Error Reporting. Machine settings takes precedence over user settings, and changes are applied immediately.
For testing purposes you can use Bad Application:
[This tool] emulates a bad application. BadApp allows you to change its process priority, start an endless loop (i.e. "hang" or stop responding) and crash its process.
Using the Group Policy Editor
Navigate to Computer Configuration > Administrative Templates > Windows Components > Windows Error Reporting.
Double-click the Prevent display of the user interface for critical errors policy, and set it to Enabled.
At least Windows Vista.
This policy setting Prevents the display of the user interface for critical errors.
If you enable this policy setting, Windows Error Reporting does not
display any GUI-based error messages or dialog boxes for critical
If you disable or do not configure this policy setting, Windows Error
Reporting displays the user interface for critical errors.
Source: Group Policy Search