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

Win7 圖示快取異常(白紙/黑塊/錯誤圖示)?.bat 一鍵重建 IconCache 與縮圖快取

編輯:Windows 7 系統介紹

現象

桌面/工作列/資料夾圖示變白紙、黑塊、錯誤圖示,乃 IconCache.db 及縮圖快取損毀所致。

方法一:完整版 .bat 腳本(含系統托盤記憶清除)

  1. 開啟記事本 → 貼上下列碼 → 另存為 重建win7圖示快取.bat(類型選「所有檔案」)。
  2. 以系統管理員身分執行(右鍵 .bat → 「以系統管理員身分執行」)。
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 重啟 Windows 殼程序 explorer
start explorer

方法二:手動刪除 IconCache.db(輕量版)

  1. 開啟任意資料夾 → 網址列輸入 %USERPROFILE%\AppData\Local → Enter。
  2. 找到 IconCache.db → 刪除。
  3. 重啟電腦或重啟 explorer 自動重建。

適用 Win7 / Vista / Server 2008。

方法三:桌面圖示黑塊專用修復 .bat

@echo off
title win7桌面圖示黑塊修復工具
reg delete "hkcu\Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /f
reg delete "hklm\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Shell Icons" /f
taskkill /f /im explorer.exe & start explorer.exe

存為 桌面圖示黑塊修復器.bat → 執行。

原理

上述方法皆屬「刪除舊快取 → 系統自動重建新快取」,本質相同,擇一執行即可。

Copyright © Windows教程網 All Rights Reserved