Icon cache corruption

Windows specific questions.
Post Reply
deltarho[1859]
Posts: 4158
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Icon cache corruption

Post by deltarho[1859] »

It is a long time since my icon cache got corrupted – years in fact. I think that this is the first time on Windows 10. If memory serves, it happened once or twice on Windows 7.

I had a batch file which rebuilt the icon cache. That seemed to work, but on a Restart the corruption remained.

I then found a batch file specifically for Windows 10 which differed to the one I had.

That seemed to work, but on a Restart the corruption remained again.

That's it. I'm going to restore a system backup and go back two days.

That did not work either. The question then is: When did the corruption occur? Unless I have to, I only Restart my machine once a week – going to Sleep in between. I do a total of 10 system backups; once per day.

I then found a method using the command prompt.

Code: Select all

Copy and paste each command below one at a time into the command prompt, and press Enter after each command.
 
ie4uinit.exe -show
 
taskkill /IM explorer.exe /F
 
DEL /A /Q "%localappdata%\IconCache.db"
 
DEL /A /F /Q "%localappdata%\Microsoft\Windows\Explorer\iconcache*"
 
shutdown /r /f /t 00
 
This last command will instantly restart the computer.
That worked after a Restart and all is well again. Phew!

So if you are on Windows 10 and your icon cache gets corrupted, then the command prompt method is your best bet.
fxm
Moderator
Posts: 11926
Joined: Apr 22, 2009 12:46
Location: Paris suburbs, FRANCE

Re: Icon cache corruption

Post by fxm »

I have a purely manual method to repair the icon cache file:
  • First try stopping the PC without restarting it, then turning it back on
    (only works in case the cache file is still valid, but not the current display).
    (do not restart otherwise the cache file will be updated from the invalid display)

    Else (corrupt cache file):
    - in 'C:\Users\...\AppData\Local', delete the 'IconCache.db' file (=> 'IconCache.db.old' for example)
    - stop the PC without restarting it
    - turn back on the PC (the icons should be correctly visualized again)
    - restart the PC to rebuild the 'IconCache.db' file.
deltarho[1859]
Posts: 4158
Joined: Jan 02, 2017 0:34
Location: UK
Contact:

Re: Icon cache corruption

Post by deltarho[1859] »

I checked the latest bat file and cannot figure why it didn't work.

Note that in the above command prompts, there are two DELs.

I hate the little arrows on desktop shortcuts. Every time I got a Windows Update, they came back. I don't know when, but Windows Update stopped doing that. I reckon a lot of folk gave them hell. :)
Post Reply