Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學

Win7 如何設定關機自動清理暫存垃圾檔案?建立 .bat 腳本 + 群組原則關機腳本實現

編輯:Win7 系統應用技巧

電腦長期使用產生大量暫存檔佔用 C 槽、拖慢速度。設定關機自動清理,讓系統自動保持乾淨:

步驟 1:建立清理腳本

  1. 記事本輸入:del /q /s %TEMP%\*(清理使用者暫存資料夾)
    或指定路徑:del /q /s "C:\Windows\Temp\*"
  2. 另存為桌面 清理暫存檔.bat。

步驟 2:加入關機腳本

  1. Win + R → gpedit.msc → 電腦設定 → Windows 設定 → 指令碼 (啟動/關機) → 「關機」 → 雙擊。
  2. 「新增」 → 「瀏覽」 → 選取桌面 清理暫存檔.bat → 確定 → 套用/確定。
進階:腳本可擴充清理 C:\Windows\Prefetch、瀏覽器快取、回收站等;Home 版無群組原則可用工作排程器「觸發:關機時」執行 .bat 達成同樣效果。
Copyright © Windows教程網 All Rights Reserved