系統用久了、裝軟體多、瀏覽網頁久,垃圾檔案佔據大量空間。自寫批次檔比第三方工具更透明、安全,實測可釋放 1-2GB。
@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
清除系統垃圾.bat (副檔名 .bat)。*.tmp, *._mp, *.log, *.gid, *.chk, *.old:各類暫存/備份/索引檔。recycled\*.*:資源回收筒內容。%windir%\*.bak, %windir%\prefetch\*.*:系統備份與預讀快取。%windir%\temp:系統暫存資料夾 (刪除後重建)。%userprofile%\Cookies, Recent, Temporary Internet Files, Local Settings\Temp:使用者層級暫存、Cookie、瀏覽快取、最近使用清單。/f 強制刪除唯讀、/s 遞迴子目錄、/q 安靜模式不提示。%systemdrive%, %windir%, %userprofile%) 自動適配不同安裝路徑/使用者。長期使用系統、頻繁上網者,每週執行一次,保持系統輕盈。