伺服器/無人值守工作站最怕「死機沒人按 Reset」。透過兩個註冊表鍵值,讓系統在**核心停止錯誤 (BSOD)** 與 **Explorer 殼崩潰** 時自動重啟,實現無人值守高可用性。
HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\CrashControlAutoReboot (REG_DWORD)1 = 啟用自動重啟 (預設);0 = 停用 (停留在藍畫面供除錯)。HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\WinlogonAutoRestartShell (REG_DWORD)1 = 偵測到 Explorer 異常終止自動重啟殼;0 = 不重啟 (桌面永久消失)。@echo off
reg add "HKLM\SYSTEM\CurrentControlSet\Control\CrashControl" /v AutoReboot /t REG_DWORD /d 1 /f
reg add "HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Winlogon" /v AutoRestartShell /t REG_DWORD /d 1 /f
echo 自動重啟已啟用 (核心錯誤 + 殼崩潰),重開機生效
pause
同路徑 CrashControl 下:
CrashDumpEnabled = 1 (完整傾印) / 2 (核心傾印) / 3 (小型傾印 64KB/128KB)。DumpFile = %SystemRoot%\MEMORY.DMP (可改路徑)。Overwrite = 1 (覆寫舊檔)。配合 AutoReboot=1,系統藍畫面 → 寫入 .dmp → 自動重啟 → 管理員事後用 WinDbg 分析 .dmp 定位故障驅動/模組。
%SystemRoot%\Minidump\),通常無需手動設定。