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

Win7 清理圖示快取 (IconCache) 批次檔一鍵修復圖示異常/空白

編輯:Win7 常見問題解答

適用症狀

  • 桌面/工作列/檔案總管圖示顯示錯誤、空白、通用預設圖示。
  • 系統托盤區圖示殘留、重複、不見。

批次檔內容 (複製存為 FixIconCache.bat)

@echo off
rem 關閉 Windows 殼程式 explorer
taskkill /f /im explorer.exe

rem 清理系統圖示快取資料庫
attrib -h -s -r "%userprofile%\AppData\Local\IconCache.db"
del /f "%userprofile%\AppData\Local\IconCache.db"

attrib /s /d -h -s -r "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\*"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_32.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_96.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_102.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_256.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_1024.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_idx.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_sr.db"

rem 清理系統托盤記憶圖示登錄
echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams
echo y|reg delete "HKEY_CLASSES_ROOT\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream

rem 重新啟動 explorer
start explorer

使用方法

  1. 將上述程式碼複製到記事本。
  2. 另存為 FixIconCache.bat (編碼 ANSI/UTF-8 均可)。
  3. 右鍵批次檔 → 「以系統管理員身分執行」。
  4. 螢幕會閃爍 (explorer 重啟),完成後圖示恢復正常。

原理解析

  • IconCache.db 為系統圖示索引資料庫,損毀導致圖示錯誤。
  • thumbcache_*.db 為縮圖快取,同理清理。
  • TrayNotify 登錄鍵值儲存托盤圖示歷史,刪除後重建。
  • taskkill /f /im explorer.exe 強制釋放檔案鎖定,確保刪除成功。
Copyright © Windows教程網 All Rights Reserved