關機等待過久,主因:CPU/記憶體佔用高、軟體過多導致關閉進程耗時、系統預設逾時值過長。提供註冊表調優與垃圾清理腳本雙管齊下。
regedit。AutoEndTasks → 雙擊修改數值為 1(強制自動結束未回應程式)。HungAppTimeout → 2000 (毫秒)WaitToKillAppTimeout → 2000MenuShowDelay → 0 (取消選單延遲)HKEY_CURRENT_USER\Control Panel\Desktop\HungAppTimeout → 5000WaitToKillAppTimeout → 4000HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Control\WaitToKillServiceTimeout → 4000NVIDIA Driver Helper Service 改為「手動」。不想手動改註冊表,用 360「減少開機項、一鍵清理」;實在不行重灌系統(盜版系統優化程度參差不齊,驅動整合度影響開關機速度)。
記事本存為 清除系統垃圾.bat(編碼 ANSI),雙擊執行約 1 分鐘清理完畢:
@echo off
echo 正在清除系統垃圾文件,請稍等......
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
del /f /s /q %systemdrive%\*.log
del /f /s /q %systemdrive%\*.gid
del /f /s /q %systemdrive%\*.chk
del /f /s /q %systemdrive%\*.old
del /f /s /q %systemdrive%\recycled\*.*
del /f /s /q %windir%\*.bak
del /f /s /q %windir%\prefetch\*.*
rd /s /q %windir%\temp & md %windir%\temp
del /f /q %userprofile%\cookies\*.*
del /f /q %userprofile%\recent\*.*
del /f /s /q "%userprofile%\Local Settings\Temporary Internet Files\*.*"
del /f /s /q "%userprofile%\Local Settings\Temp\*.*"
del /f /s /q "%userprofile%\recent\*.*"
echo 清除系統垃圾完成!
echo. & pause
原理:縮短系統等待程式回應的逾時時間,強制結束卡住進程;清理臨時檔釋放磁碟空間減少關機時掃描負擔。