How can i make an Application crash to trigger wermgr.exe?

Viewed 82

I need to trigger the Windows Error Reporting service (in a natural way) to investigate something. Therefore I have to crash an application. Preferably I would like to do this via script, to automate and reconstruct this step easily. Preferably i would like to crash an unimportant process like a self-created notepad.exe process or the powershell/cmd session the script is running in. Is there a simple way to do it?

1 Answers

ok, i did it via this powershell script

$code = @"
using System;
namespace HelloWorld
{
    public class Program
    {
        public static void Main(){
            Environment.FailFast("a");
        }
    }
}
"@
 
Add-Type -TypeDefinition $code -Language CSharp 
iex "[HelloWorld.Program]::Main()"
Related