Windows XP Windows 7 Windows 2003 Windows Vista Windows 綜合教學 Linux 系統教學
Windows 10 Windows 8 Windows 2008 Windows NT Windows Server 電腦軟體教學
您现在的位置: Windows教程網 >> Windows教程 >  >> Windows 綜合教學 >> 關於 Windows

Win10 不裝第三方軟體快速清理系統垃圾:批次檔一鍵清除 Temp/Log/Cookie/Prefetch/Recent 等常見垃圾目錄

編輯:關於 Windows

利用系統內建批次指令,無需安裝清理大師即可清理常見垃圾路徑。

製作步驟

  1. 桌面右鍵 > 新增 > 文字文件 > 命名 垃圾清理.txt。
  2. 打開貼入以下指令 (不含方括號):
@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 %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 清除完成!
pause
  1. 儲存 > 將副檔名 .txt 改為 .bat > 確認提示「是」。
  2. 雙擊執行,等待 DOS 視窗跑完顯示「清除完成!請按任意鍵繼續」。






注意事項

  • 指令勿包含方括號。
  • 回收桶檔案不會被清理,建議手動清空。
  • 執行前請關閉所有程式,避免刪除正在使用的暫存檔導致程式異常。
Copyright © Windows教程網 All Rights Reserved