rem 储存dump文件路径
set dump_path=d:\CrashDump
rem 需捕获dump文件名称
set catch_file=
rem 写入注册表项 DumpCount 表示最大保存dump数量,超出该数量,系统会删除老的。
reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\%catch_file%" /v DumpCount /t REG_DWORD /d 10 /f
rem 写入注册表项 DumpFolder 表示dump文件写入的路径
reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\%catch_file%" /v DumpFolder /t REG_EXPAND_SZ /d "%dump_path%" /f
rem 写入注册表项 DumpType 表示dump文件类型 2表示full dump
reg add "HKLM\SOFTWARE\Microsoft\Windows\Windows Error Reporting\LocalDumps\%catch_file%" /v DumpType /t REG_DWORD /d 2 /f
rem 创建dump文件目录
md %dump_path%
04-11
8418
![](https://csdnimg.cn/release/blogv2/dist/pc/img/readCountWhite.png)