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

Comment by Anonymous - 18 April 2010 @ 6:25 Reply

thank you.

Comment by Miss Discipline - 21 April 2010 @ 1:04 Reply

I have an old version of RegSeeker, it’s 1.55 and I have Windows XP. In RegSeeker click on tweaks you will see a button to click that says “rebuild icon cache” and it does it for you. Simple. Always make a back up before changing anything or go in and make a date in system restore just in case.

Comment by Martin - 5 June 2010 @ 9:48 Reply

Increase icon size - Apply.
Decrease icon size - Apply.

Worked brilliantly.

Thanks

Comment by Fer - 6 June 2010 @ 17:30 Reply

Thanks man! really worked!

Comment by Jasbir Singh - 6 August 2010 @ 14:27 Reply

I just want to say… THANK YOU…
If I did not come to this page… i would be reinstalling the
windows again.

Comment by PONNARASU - 19 August 2010 @ 15:07 Reply

thanks for your tips its very usefull for me thanks

Comment by LoneWolf1038 - 30 September 2010 @ 2:14 Reply

Just wanted to say thank you!!!! Been struggling 3 days trying to a way to reset my icons so they weren’t “generic”.

Making the icon size larger and then smaller did the trick!

THANK YOU!

Comment by zschlu00 - 4 December 2010 @ 6:18 Reply

u kick a _ _
thanks for the recovery

Comment by Yann - 19 December 2010 @ 17:15 Reply

@roberto: finally, 1 year later your comment helped me in understanding it was in deed nobody’s fault but mine!. As you did, I deleted “install” folders (in order to save some HDD space too) and was screwed in a row ’cause alas ain’t got no sibling computer… but I can now stop searching why this icons-napping occured :)
Anyway thank you all for your contributions, you make the web usefull, don’t ever doubt it guys !

Comment by Lucian - 27 March 2011 @ 22:14 Reply

For me it didn’t work… I’ve deleted the old IconCache.db but no new file was created :((

Comment by gopimano - 15 May 2011 @ 4:57 Reply

Thank you
I got what i wanted..
it worked for me as i did exactly what is said above.

Comment by Tyler - 4 June 2011 @ 9:39 Reply

You have no idea how much I want to thank you! My heart was racing when I saw the icon had reappeared properly :D

Comment by kiko - 8 June 2011 @ 8:36 Reply

if you deleted the file “IconCache.db” and try rerunning the explorer.exe but there was no new IconCache.db created,

1.you should have copied the file on other destination first before deleting it (you should always have a backup),
2.end explorer.exe and rerun it, if there are no new IconCache.db icon created, paste the old IconCache.db to it’s original location
3.end and rerun explorer.exe and that’s it. it worked for me. my icons were back to normal.

Comment by GC - 14 June 2011 @ 7:29 Reply

Thanks a lot! It worked for me.

Comment by chandra - 5 July 2011 @ 6:38 Reply

thanks.. very much.. |:-)

Comment by Sreejith - 15 July 2011 @ 17:52 Reply

yo it worked………. thnx guys

Comment by Paranormus - 7 November 2011 @ 17:25 Reply

Sometimes it happens that a few shortcut icons (not all) in the start/Programs menu show as generic. How did I manage to solve this issue?

E.g., I have an XP Sp3 Pro Running on a P4P-800-E Deluxe and have tghe system installed on a WD 5ooGB HDD. Suddenly, i can’t recall when it happened, Adobe Acrobat & Acrobat Distiller shortcuts icons in the start/program folder showed as Generic icons.

They worked just fine (pointing to the right target) but the original icon wasn’t showing, it showed generic indeed.
I googled the issue and have been reading about a lot of tweaks and tricks to fix the problem but, like for many others, none would help.

So I decided to go my own way. I decided to share my fix with everyone so I’ll try to explain it here.

STEP 1)
I made sure I created a restore point and backed my registry. I also chose to back up the Iconcache.db (copied its position to another HDD) but did not delete/rename it like the Task Manager solution suggests (Stop/restart explorer.exe).

STEP 2)
Next I simply opened the folder where the two target files (i.e., Acrobat.exe & Acrodist.exe) are supposed to be located. I then copied the location/folder (i.e., C:\Program Files\Adobe\Acrobat 9.0\Acrobat) displayed in the address bar.

STEP 3)
Then I went on the icons menu that were showing generic in the start/programs and right clicked on them (doing this procedure one file at the time) then chose Properties.
- In the properties dialog box you’ll see that the change icon tab (on the bottom) is grayed out but you shall also see a blank input box named “Start in:” which is the one you should fill with the copied folder address (STEP 2).

STEP 4)
Hit Apply and then Ok.

STEP 5)
Repeat STEP 2-Step 3-Step 4 for all the missing icons in the start/programs menu.

That’s all.

It worked as a charm for me and I hope it will for you as well. If not … well there’s always the ‘hammer’ solution!!! :D

Stay Blessed.

P.S.: I hope I managed to be as clear as possible for everyone to understand. On the contrary accept my apologies.

Comment by BlondeDuddess - 15 February 2012 @ 20:02 Reply

TwoHawks,

I really appreciate everyone´s input as well as your massive contribution. Must add mine after I solved the “Perfectly Good Icon Murder Mystery”. It took me hours trying nearly everything, and then some, including running MS Office fix tool and re-installing it, to no avail.

1) The Problem Core (here): Some programs simply set themselves as “default” on the registry. Once such program is uninstalled, Icons go bad and nothing can overwrite the default setting. My case was Open Office.

2) Solution found for Windows XP SP3:
a) Make a list of extensions whose icons are corrupted (mine were all MS Office products)
b) Click start -> Run-> Type Regedit -> Hit Enter
c) In the Class file, click on all extensions to be fixed and see if there is a
program already uninstalled set as default and simply delete the line.

DONE. Icons magically appeared in their best behavior.

Jest,
BlondeDuddess

Comment by jr - 2 March 2012 @ 21:01 Reply

your tips suck. one can’t eve n follow those lousy instructions as they are not verified on the computer.

Comment by LeToine - 11 April 2012 @ 12:35 Reply

Thanks a lot for the “%USERPROFILE%\AppData\Local\Iconcache.db” trick. It does the job perfectly on a RDS Session for an only user who had lost MS Office icons (only)…

Comment by Pedro - 24 August 2012 @ 16:18 Reply

Saved me with the “%USERPROFILE%\AppData\Local\Iconcache.db” erasing tip. Thanks!

Comment by Mike - 26 March 2013 @ 22:59 Reply

Thank you! Even in 2013 this came up big.

Comment by Bea - 15 April 2013 @ 5:40 Reply

Thanks, that worked well. Very easy directions well described.

Comment by Lydie - 27 May 2013 @ 22:16 Reply

After trying all the methods in the post without success, and reading through all the comments and trying several solutions mentioned including the RestoreIcons.bat, I finally hit on the solution to restore Adobe Reader icon on my Windows 8 laptop. At some point, perhaps after a Paint Shop Pro update, the Adobe Reader icon got replaced by the PSP shortcut, very annoying as both programs are heavily used. The only thing that worked for me was to replace the icon by hand.
Go to: C:\ProgramData\Microsoft\Windows\Start Menu\Programs
Scroll down below the folders to find the shortcuts and there find the bad one and delete it.
The Go to:
C:\Program Files (x86)\ Adobe (in my case)
Find the exe. Right-click and create a shortcut. Copy the shortcut to C:\ProgramData\Microsoft\Windows\Start Menu\Programs in place of the one you deleted.
Done!
Kind of laborious, but effective.
Best Regards

Comment by zord - 21 June 2013 @ 22:18 Reply

None of these worked. XP SP3, just .dll icons gone missing after these steps.

Comment by Anand Kamal sachdeva - 20 July 2013 @ 21:41 Reply

Thanks for suggesting, I just change icon size and apply and resolve my problem.

Comment by John of Western Australia - 21 July 2013 @ 11:15 Reply

I had wrong icons on every picture file. It was set to open in Windows Picture and fax, but had an MGI Photosuite icon. Tried the fix here, but didn’t work.
Then I went to my computer, tools, folder options, file types.
Click new then type the extension you want the icon to change, mine was JPG.
It will ask to un-associate the file with what is there now, then you can associate the file with what you want it to open with. Icon changed and looks good.

Comment by harsh vardhan - 23 July 2013 @ 18:33 Reply

i having a problem in my laptop, there is icon name(my picture) is showing in all drives of my computer and it doesn’t get deleted ,it comes again and again even after deleting it, if i insert any pen drive it automatically goes in the pen drive and doesn’t get deleted from there also,it gets spreads everywhere.

Comment by raj - 19 August 2013 @ 17:49 Reply

Thanks. It worked for me

Comment by pari - 20 October 2013 @ 7:03 Reply

thank you so much :) changing icon size solved the problem :))

Comment by Rubel Hossen - 21 October 2013 @ 12:12 Reply

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.

Comment by Bhagyashri - 16 September 2014 @ 14:07 Reply

Hi,

I am having the problem with my laptop for window 8.0– Icons of all display software on “start” menu & Desktop software has been changed in torrent icon.

So can you please provide me solution for that. Its very important for me. I am preparing for online exam.

Please do the needful…

Comment by Nastia - 1 October 2014 @ 19:12 Reply

John of Western Australia: THANK YOU very-very much!
I tried almost all the methods mentioned here but it was yours that helped.
Thanks!

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>