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

Win7 系統盤深度清理九大技巧 + 批次檔自動清理腳本

編輯:Windows 7 系統介紹

C 槽空間告急?從休眠檔、虛擬記憶體、Superfetch、暫存檔、系統還原、升級備份、日誌檔九大佔空大戶入手,配合自動清理批次檔,輕鬆騰出數 GB 空間。

九大清理目標與操作

  1. 休眠檔:C:\hiberfil.sys(大小 = 實體記憶體)。
    關閉休眠:管理員 CMD → powercfg -h off → 檔案自動刪除(隱藏檔需取消隱藏才能手動刪)。
  2. 虛擬記憶體:C:\pagefile.sys(預設 1.5x RAM)。
    建議:
    • RAM ≥ 8GB → 關閉或設固定小值 (1-2GB) 移至 D 槽。
    • RAM 4-8GB → 固定 2-4GB 移至 D 槽。
    • RAM < 4GB → 保留系統管理,但建議移至 D 槽。
    設定:控制台 → 系統 → 進階系統設定 → 效能設定 → 進階 → 虛擬記憶體變更。
  3. Superfetch/Prefetch 快取:C:\Windows\Prefetch\* → 全刪(重開機後自動重建常用程式快取)。
  4. 系統暫存檔:C:\Windows\Temp\*、C:\Users\<用戶>\AppData\Local\Temp\* → 全刪。
  5. 瀏覽器快取:IE → 網際網路選項 → 刪除瀏覽歷史(Cookie、暫存檔)。Chrome/Edge 同理。
  6. 系統還原點:System Volume Information 佔用極大。
    控制台 → 系統 → 系統保護 → 設定 → 「刪除」所有還原點,或調整「最大使用量」為 5-10%。
  7. Windows Update 備份:C:\Windows\SoftwareDistribution\Download\* 可刪(下次更新重新下載),但建議保留最近一次更新備份。
  8. 事件日誌:C:\Windows\System32\winevt\Logs\*、C:\Windows\System32\LogFiles\* → 可刪(事件檢視器可另存後再清)。
  9. NTFS 壓縮:C 槽右鍵 → 內容 → 勾選「壓縮磁碟機以節省空間」→ 套用至所有子資料夾/檔案(略微增加 CPU 負載,SSD 不建議)。

自動清理批次檔

@echo off
echo 正在清理系統垃圾檔案,請稍候...
del /f /s /q %systemdrive%\*.tmp
del /f /s /q %systemdrive%\*._mp
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 清理完成!
pause

另存為 CleanSystem.bat,**右鍵「以系統管理員身分執行」** 效果最佳(可清理系統資料夾)。

實測成果

作者環境:全軟體安裝後 C 槽佔用 **7GB+**(含 OS、Office、開發工具、常用軟體),清理後可穩定維持在 10-12GB 可用空間(128GB SSD 環境)。

Copyright © Windows教程網 All Rights Reserved