Windows 圖示快取損壞會導致程式圖示空白、錯誤、重疊。提供兩支即用型批次檔:clean_icon_cache.bat 清除所有圖示快取資料庫與縮圖快取;clean_tray_cache.bat 清除工作列托盤區歷史圖示記錄。雙擊執行即可立即生效,免重開機 (僅重啟 Explorer)。
@echo off
rem 關閉 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_*.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_idx.db"
del /f "%userprofile%\AppData\Local\Microsoft\Windows\Explorer\thumbcache_sr.db"
rem 重啟 Explorer
start explorer.exe
@echo off
taskkill /f /im explorer.exe
rem 清除托盤圖示歷史記錄
echo y|reg delete "HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v IconStreams
echo y|reg delete "HKEY_CURRENT_USER\Software\Classes\Local Settings\Software\Microsoft\Windows\CurrentVersion\TrayNotify" /v PastIconsStream
start explorer.exe
clean_icon_cache.bat 或 clean_tray_cache.bat。IconCache.db 儲存所有檔案/程式圖示快取,損壞即顯示錯誤。thumbcache_*.db 為縮圖快取,同理需清除。TrayNotify 登錄機碼,清除後重新開機的程式圖示將重新登記。