Rebuild icon cache to fix incorrectly displayed icons

4 July 2003 by Snakefoot | Comment » | Trackback Off
The icons used in Windows are saved in an icon cache, which has been invented to optimize the display of icons, so it doesn't have to open every exe-/dll-files and scan for icon images all the time.

This caching can become corrupted and lead to garbled/fuzzy/wrong icons:
  • An icon are changed to a different random icon
  • Several icons are drawn on top of each other
  • An icon becomes all black
There are different solutions that might help:
  • Restarting the computer will solve the problem for most people
  • Recreate the Icon-Cache by changing icon size (Another way is to Rebuild Icons in Tweak UI):
    1. Open Control Panel and double click Display-applet
    2. Select Appearance-tab and in Item-dropdown select Icon
    3. Increase Size and press Apply-button
    4. Decrease Size back to old value and press Apply-button
    5. Press Ok-button

  • Increase the limitation for the iconcache with this STRING value:

    [HKEY_LOCAL_MACHINE \Software \Microsoft \Windows \CurrentVersion \Explorer]
    Max Cached Icons = "2048" (Range = "100"-"4096", Default = "512")

  • Recreate the Icon-Cache file by deleting it
    1. Delete the hidden file ShellIconCache (Win9x/NT4/2k):

      C:\Windows\ShellIconCache or C:\Winnt\ShellIconCache

      Note in WinXP each user has their own file that is called Iconcache.db:

      C:\Documents and Settings\Your User Name\Local Settings\Application Data\Iconcache.db

      Note in Vista each user has their own file that is called Iconcache.db:

      %USERPROFILE%\AppData\Local\Iconcache.db

    2. Close down all explorer.exe processes using the Task Manager (Or else it will create a faulty file during logoff/restart)
    3. Use the Task Manager (CTRL+SHIFT+ESC) to launch the explorer.exe again (Or press CTRL+ALT+DEL to perform a restart/logoff)
    4. When the Windows Explorer (explorer.exe) starts again, it will recreate a correct Icon-Cache file

  • Uninstall Tweak UI (If installed) using the Add/Remove applet in the Control Panel.

    To uninstall by command line (WinNT+):

    rundll32.exe syssetup.dll,SetupInfObjectInstallAction DefaultUninstall 4 %Windir%\Inf\Tweakui.Inf

    To uninstall by command line (Win9x):

    rundll.exe setupx.dll,InstallHinfSection DefaultUninstall 4 C:\Windows\Inf\Tweakui.Inf

More Info MS KB Q132668
More Info MS KB Q133733
More Info MS KB Q146213
More Info MS KB Q199152
More Info MS KB Q216165

Updated: 28 February 2010

Comments:

Comment by James - 22 June 2008 @ 10:00 Reply

Thank you! I was having this problem with Windows XP — some icons in the start menu were broken along with some on the desktop.

I noticed that if I changed the Properties > Target to remove quotes, it helped with a few. But was incomplete.

I appreciate the time you took to put this article up!

Thanks,

James

Comment by Dorene - 18 October 2008 @ 20:22 Reply

My icons were corrupt and I went to MS website but it did not help. But your advice fixed it. Thank you!

Comment by Ian - 15 November 2008 @ 16:02 Reply

Hi My C Drive Icon has gone not the icon just the picture i have tried all of the above and none work ie deleting the IconCache Data Base file but it dose not replace itself on restart.
I’m running XP Home Version 2002 with Service Pk 2 Please help me

Comment by Geoff - 24 February 2009 @ 14:40 Reply

Great works and very concise instuctions

Thanks

Geoff

Comment by MajorV - 1 April 2009 @ 6:53 Reply

Thanks a million, Snakefoot! Your solution to this problem in Vista was by far the most clear, easy to implement and effective that I came across. I owe you one.

Comment by someone - 30 May 2009 @ 0:17 Reply

here are a couple things to do. first check the root of the c drive
for a file with the name autorun.inf. if it exists delete or move it
somewhere else. this file is used for the autorun feature on cds but
will in some cases get copied to the hard drive. if that is not the
case download tweakui from microsoft’s xp website at the following
location and install it.

http://www.microsoft.com/windowsxp/downloads/powertoys/xppowertoys.mspx

this should add a powertoys option to your start menu. in that sub
menu launch tweakui. the last option in the tree on the left is
repair. click it and the click the rebuild icons button on the dialog
to the right.

Comment by Vinicius - 7 July 2009 @ 5:30 Reply

Mandei meu PC p/ formatar, qdo voltou fui ver se havia perdido algum arquivo… Havia arquivo oculto, fiz a opção na configuração de “mostrar arquivos oculto”, para minha surpresa não apareceu os arquivos ocultos, mas na barra de informações mostrava que havia “X” (nº) de arquivo ocultos. Voltei na ferramentas e notei que não estava mais marcado “mostrar arquivos oculto” foi aí que notei dentro do modo de exibição que havia opção a mais que não havia antes da formatação ” ICON CACHE SIZE”, não gostei dessa opção, tem como mostrar os arquivos ocultos? Como? Win. XP. Grato

Comment by sareesh - 16 July 2009 @ 21:46 Reply

thanks a lot…….

Comment by Marco - 25 August 2009 @ 10:39 Reply

Recreate the Icon-Cache file by deleting it

1. Delete the hidden file ShellIconCache (Win9x/NT4/2k):

C:\Windows\ShellIconCache or C:\Winnt\ShellIconCache

Note in WinXP each user has their own file that is called Iconcache.db:

C:\Documents and Settings\Your User Name\Local Settings\Application Data\Iconcache.db

Note in Vista each user has their own file that is called Iconcache.db:

%USERPROFILE%\AppData\Local\Iconcache.db

2. Close down all explorer.exe processes using the Task Manager (Or else it will create a faulty file at logoff)
3. Rerun explorer.exe is enough

Comment by Snakefoot - 25 August 2009 @ 22:55 Reply

Marco wrote:
3. Rerun explorer.exe is enough

I have updated the article so it also includes this option

Comment by roberto - 22 September 2009 @ 19:49 Reply

Folks,
I had the same problem: missing, or better to say, neutralized icons (as for non-associated filetypes) for most of the common files:
Office (DOC, XLS, you name it)
PDF
GIF

even some program shortcuts!

Tried everything above, none worked :(
But then I found some notes about something and I realized: it was all MY FAULT!

In order to save some HD-space, a couple of days ago I was clever enough to delete the
C:\Windows\Installer
folder, assuming that there was only junk from previous installations!

Alas, the funny thing is, many programs get their icon cache from there! So, if you deleted it and it is gone, you are screwed like me ;)
But if you have a second computer and similar installations, you can copy over the whole Installer folder, and you are saved like me :)

Hope this helps somebody.

Peace!
R

Comment by Lars - 1 October 2009 @ 16:02 Reply

Recreating the icon-cache file by deleting it worked for me on an XP SP 2 box - thanks for the great info!

Comment by Peter - 14 November 2009 @ 12:50 Reply

LOL - Many years after your hints… Many Thanks, was getting corrupt icons after a BSOD, running w2k. Problem fixed using your last method: del shellicons, launch taskmanger close explorer.exe, run app explorer again via taskmanger.
Prob. solved. :)

Comment by siang hwee - 18 November 2009 @ 16:46 Reply

thanks a lot… it solve my problem

Comment by Luiz O - 1 December 2009 @ 7:15 Reply

Clearing and Rebuilding Icon Cache:

To automate this process open notepad and paste the code below, save it to desktop as RefreshIcons.bat, double click on the file and you are all set. You can do this every time the icon cache needs to be rebuilt. Make sure all your applications are closed whenever you run this.

taskkill /F /IM explorer.exe
cd /d %userprofile%\AppData\Local
attrib –h IconCache.db
del IconCache.db
start explorer

Comment by nerdant - 22 December 2009 @ 1:38 Reply

thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you! thank you!

Comment by Iudith - 27 December 2009 @ 9:04 Reply

Hello all,

My machine is WinXP SP3 and sometimes some of the icons are garbaged, always the same ones, namely:
- the MyMusic, My Video, Favorites, Control Panel, DVD drive
- the icons for TXT and DLL files
while other icons are ok.
Also, when this happens, trying to change any existing icon of a desktop shortcut with one from the shell32.dll file results in an error stating that “the shell32.dll file does not contain any icons”, which is a “fake” error, because it does not come back after the icon problem is corrected.

The solution with deleting IconCache.db worked for me, but only temporarily, after some time the problem is back.

Rebooting the machine does not solve the problem if it exists before the restart.
I also tried using TweakUI and sometimes it worked,
but the last time it worked only AFTER a reboot (when the problem existed before and after the reboot).

My questions are:
1. Related to the above posts, why is it important to kill the
explorer.exe using the TaskManager instead of simply closing it ? and also why to restart it using TaskManager ?
2. As far as I understand, deleting the IconCache.db and stopping/restarting the explore.exe is supposed to rebuild the file WITHOUT performing each time a reboot.
Is this correct ?
3.
Does anybody know of any solution, registry setting, a.s.o. which can solve this method PERMANENTLY, without having to use any of the tricks times and times again ?

Thanks a lot & Happy New Year to everybody !
Iudith

Comment by Steve - 15 January 2010 @ 1:29 Reply

Thank you!!! Changing the icon size & then back again did the trick. Now my Windows 2000 icons display properly again.

Comment by Marcus - 20 January 2010 @ 20:04 Reply

Probly never visit here anymore Marco but you saved my day worked like a charm im useing Windows 7 if anyone with win 7 finds this site and has same issue

Comment by Don - 11 February 2010 @ 1:48 Reply

My Malwarebytes Icon on my desktop got corrupted I guess with a virus. It will no longer operate. Tried to delete it and re download it but does the same thing. I do not know how to fix it. Any ideas

Comment by TwoHawks - 28 February 2010 @ 9:56 Reply

Hi All,
I find there are many people still struggling to sort out a solution for the Icon Cache related issue …when it continues to fail even after applying proper fixes…

Couple points, and here’s the deal…
- proper datatype is String (REG_SZ)

- if you are using known good solutions and they fail, or
- if you are setting it the correct way and it reverts from a String (REG_SZ) to a Dword (REG_DWORD) datatype and keeps failing, or
- if it just seems broken or wrong to begin with (when you first look it up in the registry),
…, there is an explanation, and a solution, for this.

It could be because of a third party element that is rewriting the registry key “Max Cached Icons”
- Widcom Broadcom BlueTooth Drivers have been known to do this.
They were informed about it, fixed it, and some of their drivers have been known to have been fixed…
- but I have the latest drivers and they are ‘broken’ again…

No matter what the deal may be that is “undoing” this for you, I finally figured a workaround.
I posted about it here:
http://www.experts-exchange.com/articles/OS/Microsoft_Operating_Systems/IconCache-Max-Cached-Icons-DataType-Reverting-Incorrectly-from-STRING-to-DWORD-SOLUTION.html

…complete with proper credit where its due.

Its long because its detailed and thorough.
I hope its helpful to those who may find it.
Thanks to the host for providing ability to post and share here ;^)

Cheers,
TwoHawks

Comment by Snakefoot - 28 February 2010 @ 15:12 Reply

TwoHawks wrote:
Couple points, and here’s the deal…
- proper datatype is String (REG_SZ)
- It could be because of a third party element that is rewriting the registry key “Max Cached Icons”

Thank you for the update. I have re-read the Microsoft article, and have now changed the datatype from DWORD to STRING.

Very annoying that 3rd party applications modifies those registry settings for the Windows Explorer. Hope others in your situation will benefit from your experiences.

Comment by ellery - 14 March 2010 @ 14:49 Reply

Hi all,
congratulation for the good page.

Same problem, XP Home, after a convert from FAT32 to NTFS.
all Office and Adobe icons disapeared.

These icons are connected to the so called “advertised shortcuts” (http://www.google.com/search?q=advertised%2Bmsi%2Bshortcuts), in short those strange shortcuts without a path to the exe.

The icons are connected to the content of the “windows\installer” folder (system, hidden) that for some strange reason was not converted by convert.exe procedure.

Fortunately I had a backup that I made before the conversion. After a restore of the installer folder the and a restart of explorer.exe (terminated ad re-executed from task manager), every icon was back in place.

I hope its helpful to those who may find it.
Thanks to the host for providing ability to post and share without formalities…

Cheers,
Ellery

Leave a comment


NB! Use the Forum for computer help and off-topic questions.

You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>