Windows 7环境下重置图标缓存

    图标缓存可以加速图标的显示,但是有时,如果图标发生了改变,但是并没有正常显示时,我们需要重建图标的缓存,把如下代码保存为.cmd文件运行即可。

rem 关闭Windows外壳程序explorer
taskkill /f /im explorer.exe
 
rem 清理系统图标缓存数据库
attrib -h -s -r "%userprofile%AppDataLocalIconCache.db"
del /f "%userprofile%AppDataLocalIconCache.db"
attrib /s /d -h -s -r "%userprofile%AppDataLocalMicrosoftWindowsExplorer*"
del /f "%userprofile%AppDataLocalMicrosoftWindowsExplorerthumbcache_32.db"
del /f "%userprofile%AppDataLocalMicrosoftWindowsExplorerthumbcache_96.db"
del /f "%userprofile%AppDataLocalMicrosoftWindowsExplorerthumbcache_102.db"
del /f "%userprofile%AppDataLocalMicrosoftWindowsExplorerthumbcache_256.db"
del /f "%userprofile%AppDataLocalMicrosoftWindowsExplorerthumbcache_1024.db"
del /f "%userprofile%AppDataLocalMicrosoftWindowsExplorerthumbcache_idx.db"
del /f "%userprofile%AppDataLocalMicrosoftWindowsExplorerthumbcache_sr.db"
 
rem 清理 系统托盘记忆的图标
echo y|reg delete "HKEY_CLASSES_ROOTLocal SettingsSoftwareMicrosoftWindowsCurrentVersionTrayNotify" /v IconStreams
echo y|reg delete "HKEY_CLASSES_ROOTLocal SettingsSoftwareMicrosoftWindowsCurrentVersionTrayNotify" /v PastIconsStream
 
rem 重启Windows外壳程序explorer
start explorer