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

Windows 8 批次檔一鍵清理垃圾檔案,加速系統效能

編輯:Win8 系統應用技巧

電腦使用久了會累積大量暫存檔、日誌、快取等垃圾檔案,拖慢速度。利用批次檔一鍵清理常見垃圾路徑,無需安裝第三方清理軟體,安全且高效。

製作步驟

  1. 桌面右鍵 → 新增 → 文字文件,命名為 clean.bat(副檔名必須為 .bat)。
  2. 用記事本開啟,貼上以下程式碼並儲存:
@echo off
color 1e
echo 正在清理系統垃圾檔案,請稍候...
for /r c: %%a in (*.tmp *.chk *.gid *._mp *.old *.bak *.log) do del /f /s /q "%%a"
for /r c:\windows\temp %%a in (*.*) do del /f /s /q "%%a"
for /r c:\windows\Prefetch %%a in (*.*) do del /f /s /q "%%a"
for /r "%userprofile%\AppData\Local\Temp" %%a in (*.*) do del /f /s /q "%%a"
for /r "%localappdata%\Microsoft\Windows\Temporary Internet Files" %%a in (*.*) do del /f /s /q "%%a"
for /r "%localappdata%\Microsoft\Windows\History" %%a in (*.*) do del /f /s /q "%%a"
for /r "%appdata%\Microsoft\Windows\Cookies" %%a in (*.*) do del /f /s /q "%%a"
for /r "%windir%\SoftwareDistribution\Download" %%a in (*) do del /f /s /q "%%a"
for /r "%windir%\Downloaded Program Files" %%a in (*) do del /f /s /q "%%a"
for /r "%windir%\System32\LogFiles" %%a in (*) do del /f /s /q "%%a"
del /f /s /q %systemdrive%\hiberfil.sys
echo 清理完成!
pause & exit
  1. 以系統管理員身分執行 clean.bat(右鍵選擇「以系統管理員身分執行」)。

清理涵蓋路徑說明

  • 系統暫存檔、檢查點檔、備份檔、日誌檔
  • Windows Temp、Prefetch(預讀取)、Windows Update 下載快取
  • 使用者暫存資料夾、IE/Edge 快取、歷史記錄、Cookie
  • 休眠檔 hiberfil.sys(若不使用休眠可釋放大量空間)

注意: 執行前建議關閉所有程式;hiberfil.sys 刪除後休眠功能將失效,可用 powercfg /h on 重新啟用。定期執行可保持系統輕盈。

Copyright © Windows教程網 All Rights Reserved