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

Windows 圖示顯示異常?一鍵 BAT 清除圖示快取與工作列托盤歷史記錄

編輯:關於 Windows

Windows 圖示快取損壞會導致程式圖示空白、錯誤、重疊。提供兩支即用型批次檔:clean_icon_cache.bat 清除所有圖示快取資料庫與縮圖快取;clean_tray_cache.bat 清除工作列托盤區歷史圖示記錄。雙擊執行即可立即生效,免重開機 (僅重啟 Explorer)。

clean_icon_cache.bat 內容

@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

clean_tray_cache.bat 內容

@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

使用方式

  1. 記事本貼上對應程式碼,存為 clean_icon_cache.bat 或 clean_tray_cache.bat。
  2. 右鍵以系統管理員身分執行 (或一般雙擊,Win10/11 需管理員權限才能刪除受保護快取)。
  3. 螢幕閃爍一下 (Explorer 重啟) 即完成,圖示恢復正常。

原理說明

  • IconCache.db 儲存所有檔案/程式圖示快取,損壞即顯示錯誤。
  • thumbcache_*.db 為縮圖快取,同理需清除。
  • 托盤歷史記錄儲存於 TrayNotify 登錄機碼,清除後重新開機的程式圖示將重新登記。
Copyright © Windows教程網 All Rights Reserved