**LocalDumps** makes Windows Error Reporting write a file every time the app crashes. The keys are machine-wide by default, and a subkey named after the executable narrows it to one app.
reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /v DumpFolder /t REG_EXPAND_SZ /d C:\CrashDumps /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /v DumpType /t REG_DWORD /d 2 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps" /v DumpCount /t REG_DWORD /d 5 /f
mkdir C:\CrashDumps
⚠ warningA full dump of a large application can be several gigabytes. Set DumpCount and keep the folder on a drive with room.