Guide to Enable Minidumps on Windows Using a Batch Script
Enabling minidumps on Windows can be done by modifying the system registry and ensuring that the pagefile is appropriately configured. Below is a step-by-step guide to achieve this using a batch script.
Create the Batch Script
- Open Notepad:
- Press Win + R, type notepad, and press Enter.
- Write the Batch Script:
- Copy and paste the following code into Notepad:
Code:
@echo off
REM Batch file to enable minidump creation on Windows 10 and 11
echo Enabling Minidump Creation...
REM Set system properties for minidump creation
echo Configuring system properties...
reg add "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v CrashDumpEnabled /t REG_DWORD /d 3 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v "MinidumpDir" /t REG_EXPAND_SZ /d "%SystemRoot%\Minidump" /f
REM Ensure the pagefile exists and is properly sized
echo Configuring pagefile settings...
reg add "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Memory Management" /v PagingFiles /t REG_MULTI_SZ /d "C:\pagefile.sys 0 0" /f
REM Configure Startup and Recovery settings
echo Configuring Startup and Recovery settings...
reg add "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v LogEvent /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v AutoReboot /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v OverwriteExistingDebugFile /t REG_DWORD /d 1 /f
reg add "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v "CrashDumpEnabled" /t REG_DWORD /d "3" /f
REM Restart the computer to apply changes
echo Restarting the computer to apply changes...
shutdown.exe -r -t 00
echo Minidump creation enabled successfully.
Save the Batch Script
- Save the File:
- Click File > Save As.
- In the “Save as type” dropdown, select All Files.
- Name your file with a .bat extension, for example, enable_minidumps.bat.
- Choose a location to save it, such as your Desktop or Documents folder.
Run the Batch Script
- Run as Administrator:
- Right-click on the saved batch file (enable_minidumps.bat) and select Run as administrator.
- If prompted by User Account Control (UAC), click Yes to allow it to make changes.
- Verify Execution:
- A Command Prompt window will open, execute the commands, and display a message indicating that the minidump configuration has been updated.
- Press any key to close the Command Prompt window when prompted.