Skip to content

Instantly share code, notes, and snippets.

@iaoedsz2008
Created October 8, 2019 10:32
Show Gist options
  • Save iaoedsz2008/6e3fb2564830e0d8d94f21837ceb2c36 to your computer and use it in GitHub Desktop.
Save iaoedsz2008/6e3fb2564830e0d8d94f21837ceb2c36 to your computer and use it in GitHub Desktop.
Windows 强制刷新图标缓存
echo 正在关闭资源管理器...
taskkill /f /im explorer.exe
echo 正在清理系统图标缓存数据库...
attrib -h -s -r "%userprofile%\AppData\Local\IconCache.db"
echo /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"
echo 正在清理系统托盘记忆图标...
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
echo 正在重启资源管理器...
start explorer
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment