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

Win7 最快清理系統垃圾:自製 clean.bat 一鍵刪除 tmp/log/gid/chk/old/bak/回收筒/預讀/Cookie/暫存網頁檔

編輯:Windows 7 系統介紹

系統垃圾佔據百 MB 甚至 GB 空間,拖慢效能。記事本存成 .bat,雙擊 30 秒清空所有常見垃圾類型,比優化大師更徹底、不傷系統檔。

製作步驟

  1. 記事本貼上下列程式碼。
  2. 「另存新檔」→ 路徑「桌面」→ 檔案類型「所有檔案」→ 檔名 清除系統垃圾.bat (副檔名必為 .bat)。
  3. 雙擊執行,約 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 /q %userprofile%\recent\*.*
echo 清除系統垃圾完成!
echo. & pause

清理項目說明

  • *.tmp / *._mp — 暫存檔
  • *.log — 日誌檔
  • *.gid — 說明檔索引
  • *.chk — 磁碟檢查片段
  • *.old / *.bak — 備份檔
  • recycled — 回收筒殘留
  • prefetch — 預讀快取 (重開機自動重建)
  • temp / Temporary Internet Files / cookies / recent — 使用者暫存/網頁快取/Cookie/最近使用

安全性

僅刪除公認垃圾路徑/副檔名,**不觸動系統核心檔/使用者文件/登錄檔**,公司/家用環境均安全。可排程每週自動執行。

Copyright © Windows教程網 All Rights Reserved