How to Clear and Rebuild the Icon Cache in Windows

Icon cache corruption may happen sometimes, causing wrong icons to show up for certain programs or in certain areas of the Windows shell, or no icons at all.

My earlier post Incorrect icon shown for a file type tells you how to refresh the shell icons using Default Programs. In case the solution posted in that link does not help, you may want to completely clear and rebuild icon cache database. This post explains how to do so, using a Script I wrote, or manually, for all versions of Windows including Windows 10.

Automatically Clear the Icon Cache Using Script

To clear the icon caches for Windows Vista, 7, 8 and Windows 10, download the zip file below, unzip and run Vbscript file cleariconcache.vbs.


Download cleariconcache.zip

If any other programs are using the icon cache, the cache cannot be cleared. Save all your work, and close all programs and then double-click the script.

Click Yes when you’re prompted to restart the shell.

If the Icon Cache database files can’t be deleted, some programs are using it. Close all applications and try running the script again.

After clearing the cache, Explorer shell should start automatically, and rebuilds fresh set of icon caches.

That’s it!

Rebuilding the Icon Cache Database Manually

1. Close all folder windows that are currently open.



2. Launch Task Manager using the CTRL+SHIFT+ESC key sequence, or by running taskmgr.exe.

3. In the Process tab, right-click on the Explorer.exe process and select End Process.

4. Click the End process button when asked for confirmation.

5. From the File menu of Task Manager, select New Task (Run…)

6. Type CMD.EXE, and click OK

7. In the Command Prompt window, type the commands one by one and press ENTER after each command:

CD /d %userprofile%\AppData\Local
DEL IconCache.db /a

This should clear the icon cache in Windows Vista, 7, 8, and 10.


Additionally, in Windows 8 and Windows 10, icon cache database is also stored in %userprofile%\AppData\Local\Microsoft\Windows\Explorer. To clear them, you must close all running applications, and run these commands in the Command Prompt. If you receive Access is Denied error when running the deleting the IconCache*.db files, then one or more of the open programs is using the icon cache database. Close all programs and try again, or try clearing them from Safe mode.

CD %userprofile%\AppData\Local\Microsoft\Windows\Explorer
DEL IconCache*.db /a
EXIT

8. In Task Manager, click File, select New Task (Run…)

9. Type EXPLORER.EXE, and click OK.

Editor’s note: Instead of using Task Manager to exit Explorer.exe, even better way to do this is to terminate the Explorer.exe Shell cleanly using the method described in article Terminate and Restart Explorer.exe Process Cleanly in Windows 7 & Windows Vista, or if you’re using Windows 8 or Windows 10, check the article How to Exit Explorer and Restart Explorer in Windows 10 and Windows 8?.

About the author

Ramesh Srinivasan founded Winhelponline.com back in 2005. He is passionate about Microsoft technologies and has a vast experience in the ITeS industry — delivering support for Microsoft's consumer products. He has been a Microsoft MVP [2003 to 2012] who contributes to various Windows support forums.

100 thoughts on “How to Clear and Rebuild the Icon Cache in Windows

  1. Great advice!
    This has ended my frustration over not being able to restore the Icons to the format as per the original source.
    Thank you.

  2. Absolutely Wonderful!

    Except for the ones (note pad) I changed to the closest I could find before taking your advice, they all returned to normal.

    Thank you!

  3. Oh hell yes this worked. When you’re typing the commands make sure to actually type %userprofile% and not your actual profile name

  4. My its saying dat it could not find c:\User\Lameck\AppData\Local\IconCache.dba just after passing des command DEL IconCache.dba /a

  5. i have a database its folder is cwcheat then the database is CHEAT and i accidentally opened it with Microsoft words work processor now when i open it it then automatically opens in Microsoft words work processor even if it is a database file please help me how to change its old icon or program back

  6. Although the files open in the c: drive with the correct program, the files in the drive still have the generic labels instead of their respective opening icons. Windows 7 64 bit professional. Worth a try though. Thanks

  7. Although, the program file opens fine, the program files in the drive still are missing the icons to their respective programs. Windows 7-64 bit Professional Worth a Shot though.

  8. Worked–thanks. My issue was that the icon for a program (CorelDRAW) was appearing fine in Explorer, and on the pop-up window when ALT-TABbing, but not on the task bar.

  9. Yea!!!! This worked! The other fixes I’d tried didn’t work on my Win 7 64 bit pc, but this one did, and it’s easy. Thank you!

  10. It dosen’t work in my case. Still the icons are remain as it is……….. :(

    Please some one tel me the solution

  11. Thank you! I just switched to a new computer and deleted some desktop shortcuts, and this problem happened to me. The solution worked like a charm!!

  12. Wow. I can’t believe it, for the first time something like this actually worked 100% flawlessly. Thank you very much, good sir/ma’am

  13. THIS WORKED 100%

    My Adobe Photoshop CS6 Icon was missing, and this helped me to restore it again. Simple steps and no risks!

  14. HOLY CRAP THIS WORKS. I had locks on my folders for some reason, now all the locks are gone. THANK YOU SOOO MUCH!!!!!!!

  15. As Mike said, it absolutely does work like a charm. Thanks so much, the bad Outlook icon has been bugging me for months!

  16. Thanks so much – worked perfect for me (Windows 7 on a Dell)
    I would also like to know what caused the problem in the first place.
    Kind regards
    david

  17. Brilliant! I would add that there is a space in the first line between /d and %userprofile%. Also in the second line between IconCache.db and /a

    Took me two tries. Thanks again!

  18. Awesome! Lost Outlook 2010 icon in task bar bizarrely – followed your instructions and ‘boom’, icon appeared. Cheers!

  19. I have Vista and the above directions did not work. the cmds that i was to type “one by one” was not recognized..

  20. Thanks, but I solved it by going into Safe Mode, for which I didn’t need the screen to initiate it and then going into System restore , about 6 days, which sorted me out.

  21. After “del iconcache.db /a” you can enter “explorer” in the same window to be even faster!

    Thank you Ramesh!

  22. Thank you for your info, and help in restoring all my icon, no one else seemed to have a clue, glad someone is professional in their approach. Tahnks again.

  23. Thanks I installed a theme and even after uninstalling it it left the icons behind. This fixed it

  24. I think this has worked! Many thanks indeed, you do a great service to hapless Windows suffers (and who is not?).

  25. You need to type “%userprofile%” exactly like that (without the quotes obviously). Dont put in your actual user name.

  26. Thanks so much, this actually works. Tried so many other ways of doing this and they all dont work.

  27. Thank you so muuuuch! I’ve downloaded many programs but none of them worked! Thank yooou so much for this

  28. That was amazing!! I’m blown away!! I’ve been tryign to fix this issue for a REEEEAALY lomg time!!! THANKS!!!!!!!!!!

  29. Better method:

    Open notepad, paste this exactly:

    TASKKILL /f /im explorer.exe
    CD /d %userprofile%\AppData\Local
    DEL IconCache.db /a
    START explorer.exe
    EXIT

    Save it as “fix icons.bat”, with file type “All types”.

    Run the batch file any time your icons are screwed up.

    The reason this is better is that it automatically kills explorer.exe, deletes the icon cache for you, and restarts explorer.exe.

  30. This worked like a charm. Thanks!! It annoyed me to death but wasn’t worth a fresh install. Thanks for this solution!

Comments are closed.