清除图标缓存(不需要重启)
批处理
Win10
ie4uinit -show
Win10之前的系统
ie4uinit.exe -ClearIconCache
关于 ie4uinit 的介绍,参见 https://www.file.net/process/ie4uinit.exe.html
What is ie4uinit.exe?
The genuine ie4uinit.exe file is a software component of Internet Explorer by Microsoft Corporation.
"Ie4uinit.exe" is a Microsoft utility program having both 32-bit and 64-bit versions. The version matching the machine resides in "C:\Windows\System32". On 64-bit machines the 32-bit version is also run from "C:\Windows\SysWOW64". Called the "Internet Explorer Per-User Initialization Utility," it performs operations on the Icon Cache Database, a hidden ".db"-type file in the "%userprofile%\AppData\Local" subdirectory, determined by command-line switches including "-BaseSettings", "-UserIconConfig", "-ClearIconCache", or "-Reinstall." (In Win10 its switches differ.) The Icon Cache retains copies of icons being used by Windows or IE to avoid repeatedly redrawing them. Most often "ie4uinit.exe" runs during Active Setup, where Windows detects at user login whether a user's profile lacks certain registry subkeys in the Current User (HKCU) hive that exist in the Local Machine (HKLM) hive, performs specific functions, and then puts those subkeys in HKCU to prevent repetition. This is an essential tool in enterprise installations with many endpoints.
一句话版
cmd /c taskkill /f /im explorer.exe & del /a %userprofile%\AppData\Local\IconCache.db & start explorer
代码版
SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, NULL, NULL);
手动版
自Vista以来,以下方法一直有效。它要求资源管理器重新启动,但无需重新启动。 简短版本:停止所有explorer.exe实例,删除用户的隐藏IconCache.db文件,然后重新启动资源管理器。 长版(还有其他方法): 关闭所有当前打开的资源管理器窗口。 使用+ + 键序列或通过运行启动任务管理器。CTRLSHIFTESCtaskmgr.exe 在“ 流程”选项卡中,右键单击explorer.exe流程,然后选择“ 结束流程”。 当要求确认时,单击“ 结束进程”按钮。 从任务管理器的文件菜单中,选择新建任务(运行…) 键入CMD.EXE,然后单击确定。 在“命令提示符”窗口中,一一键入命令,然后ENTER在每个命令之后按: CD /d %userprofile%\AppData\Local DEL IconCache.db /a EXIT 在“ 任务管理器”中,单击“ 文件”,选择“ 新建任务(运行…)”。 键入EXPLORER.EXE,然后单击确定。 指令步骤源 警告:删除IconCache.db文件时,不要运行Explorer.exe非常重要。如果资源管理器正在运行,它将在下次关闭时(例如,注销,关闭或重新启动时)简单地写出当前(损坏的)图标。