We may face the icon cache corruption issue sometimes in Windows 10/11 and earlier OS. The icon cache corruption causes the wrong icons to show up for certain programs or in certain areas of the Windows shell, or no icons at all. For example, your pinned taskbar shortcuts may show up with the wrong icon.
My earlier post Incorrect icon shown for a file type tells you how to refresh the shell icons using Default Apps. In some cases, the old icon may still show up after changing the file type association.
To render the icons for various shell objects like folders, special folders, and files, Windows caches the icons in database files so that Windows doesn’t have to read the file or folder icon and extract them every time. Occasionally, you’ll see icon-caching bugs in Windows resulting in incorrect, missing, or out-of-date icons being shown for programs and desktop shortcuts and other areas of the shell.
To resolve the incorrect icons issue, you may want to clear and rebuild the icon cache database completely. This post explains how to accomplish the task using different methods. The instructions apply to all versions of Windows, including Windows 11.
Clear and Rebuild the Icon Cache:
Before proceeding, try a simple fix like the ie4uinit.exe refresh method. In many situations, all that you need to do is refresh the icons without the need to clear and rebuild them.
If refreshing the icons using ie4uinit.exe or Default Apps doesn’t help, you’ll have to clear the icon cache completely.
How to Clear and Rebuild the Icon Cache in Windows
Let’s see how to clear the icon cache completely and let Windows rebuild it automatically.
1) Clear & Rebuild icon cache using ClearIconCache.exe Utility
Clear Icon Cache (ClearIconCache.exe) utility from Leo Davidson will cleanly exit Explorer, delete the shell icon cache (IconCache*.db), and localized thumbnail cache (ThumbCache*.db), and then restart Explorer.
Leo Davidson is a trusted source — he is the one who wrote the famous PDF x64 thumbnail & preview fix for Windows some years back. And he’s the owner of FileTypeDiag and many other useful portable tools.
With Clear Icon Cache, you double-click the program, and it takes care of the details for you. Clear Icon Cache works in Windows Vista, Windows 7, Windows 8, and Windows 10. Though Windows 11 isn’t mentioned, it should work on Windows 11 without any issues.
To run the utility in noninteractive or silent mode, run ClearIconCache.exe /QUIET
As said earlier, the utility also clears the thumbnail caches on the computer.
RELATED: How to Restart Explorer Gracefully Using Shortcut or Command-line
2: Clear & Rebuild the Icon Cache Database Manually
The icon cache database files are located in your %LocalAppData%
folder with file names prefixed with iconcache_
– each icon size has a separate cache (database) file.
The file names look like this:
iconcache_16.db iconcache_32.db iconcache_48.db iconcache_96.db iconcache_256.db iconcache_768.db iconcache_1280.db iconcache_1920.db iconcache_2560.db iconcache_exif.db iconcache_idx.db iconcache_sr.db iconcache_wide.db iconcache_wide_alternate.db
To clear the icon cache manually, follow these steps:
- Close all folder windows that are currently open.
- Launch Task Manager using the Ctrl + Shift + Esc key sequence.
- In the Task Manager Process tab, right-click on the Explorer.exe process and select End Process.
Note: It’s even better if you exit explorer gracefully. See instructions for Windows 7 and Windows 10 to know how to quit the Explorer.exe shell process gracefully. Don’t restart a new explorer.exe process yet!
- Click the End process button when asked for confirmation.
- From the File menu of Task Manager, select New Task (Run…)
- Type CMD.EXE, and click OK
- 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
- Additionally, in Windows 8, Windows 10, and Windows 11, the 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.CD %userprofile%\AppData\Local\Microsoft\Windows\Explorer DEL IconCache*.db /a EXIT
If you receive Access is Denied error when 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.
- In Task Manager, click File, select New Task (Run…)
- Type EXPLORER.EXE, and click OK.
Editor’s note: Instead of using Task Manager to exit Explorer.exe in Step 3 above, an even better way to do this is to terminate the Explorer.exe Shell cleanly using the method described in the article Terminate and Restart Explorer.exe Process Cleanly in Windows 7. If you’re using Windows 8, Windows 10, or Windows 11, check the article How to Exit Explorer and Restart Explorer in Windows 10/11.
Method 3: Automatically Clear & Rebuild the Icon Cache Using Script
This method uses a small script that I wrote to clean up the icon cache completely. Once done, the script restarts the Explorer shell for the change to take effect.
Contents of the Script – Cleariconcache.vbs
'cleariconcache.vbs
'Clears the icon cache databases to lets Windows rebuild them fresh.
'for Windows Vista, 7, 8, Windows 10, Windows 11.
'Written by Ramesh Srinivasan.
'Written on Jan 31 2016
'Updated on Apr 01 2016
'Reviewed on Aug 02 2022
'https://www.winhelponline.com/blog/
Option Explicit
Dim WshShell, objFSO, strICPath1, strICPath2, strmsg, rtnStatus, Process, iDirtyFlags, iDirtyFlags2
Const DeleteReadOnly = True
Set WshShell = WScript.CreateObject("WScript.Shell")
Set objFSO = CreateObject("Scripting.FileSystemObject")
strICPath1 = WshShell.ExpandEnvironmentStrings("%LOCALAPPDATA%")
strICPath2 = strICPath1 & "\Microsoft\Windows\Explorer"
ExitExplorerShell
WScript.Sleep(3000)
ClearIconCache
WScript.Sleep(2000)
StartExplorerShell
Sub ExitExplorerShell()
strmsg = "Explorer Shell will be terminated now."
strmsg = strmsg & " Please save all your work and close all programs."
strmsg = strmsg & "Icon cache may not be cleared if programs are using them. Want to continue?"
rtnStatus = MsgBox (strmsg, vbYesNo, "Clear the Icon Cache")
If rtnStatus = vbYes Then
For Each Process in GetObject("winmgmts:"). _
ExecQuery ("select * from Win32_Process where name='explorer.exe'")
Process.terminate(1)
Next
ElseIf rtnStatus = vbNo Then
WScript.Quit
End If
End Sub
Sub StartExplorerShell
WshShell.Run "explorer.exe"
End Sub
Sub ClearIconCache()
If (objFSO.FileExists(strICPath1 &"\IconCache.db")) Then
On Error Resume Next
objFSO.DeleteFile strICPath1 &"\IconCache.db", DeleteReadOnly
On Error Goto 0
If Err.Number <> 0 AND Err.Number <> 53 Then
iDirtyFlags = 1
End If
End If
If objFSO.FolderExists(strICPath2) Then
On Error Resume Next
objFSO.DeleteFile(strICPath2 & "\icon*.db"), DeleteReadOnly
On Error Goto 0
If Err.Number <> 0 AND Err.Number <> 53 Then
iDirtyFlags2 = 1
End If
End If
WshShell.Run "ie4uinit.exe -ClearIconCache"
WshShell.Run "ie4uinit.exe -show"
End Sub
If iDirtyFlags = 1 Then
rtnStatus = MsgBox ("Some programs are still using the IconCache.db in LOCALAPPDATA. Close all programs and try again", vbOKonly, "Clear the Icon Cache")
End If
If iDirtyFlags2 = 1 Then
If iDirtyFlags <> 1 Then
rtnStatus = MsgBox ("Some programs are still using the cache in Location 2. Close all programs and try again", vbOKOnly, "Clear the Icon Cache")
End If
End If
If iDirtyFlags = 0 And iDirtyFlags2 = 0 Then
MsgBox "Successfully cleared the Icon Caches.", vbOKOnly, "Clear the Icon Cache"
End If
Set WshShell = Nothing
Set objFSO = Nothing
How to Use?
- Download
cleariconcache.vbs
or create the VBScript file manually using Notepad. - Save all your work and close all programs, so that icon cache files are not locked by any program.
- Double-click the script file
cleariconcache.vbs
- Click Yes when you’re prompted to restart the shell.
Optionally, when the following dialog shows up, you can manually terminate the explorer shell gracefully (instead of the script doing it forcefully). See instructions for Windows 7 and Windows 10/11 to know how to quit the Explorer.exe shell process gracefully. Don’t restart a new explorer.exe process yet! Once done, click Yes.
If the Icon Cache database files can’t be deleted, some programs are using them. Close all applications and try rerunning the script.
It should be able to delete the icon cache files.
After clearing the cache, the Explorer shell should start automatically and rebuild a fresh set of icon cache.
I hope you were able to fix icon rendering issues on your Windows computer by clearing the icon cache completely.
One small request: If you liked this post, please share this?
One "tiny" share from you would seriously help a lot with the growth of this blog. Some great suggestions:- Pin it!
- Share it to your favorite blog + Facebook, Reddit
- Tweet it!
This worked like a charm. Thanks!! It annoyed me to death but wasn’t worth a fresh install. Thanks for this solution!
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.
Excellent 🙂
I love you
Thanks for having such a simple and straight-forward way to fix this situation!
You rule!
Thanks! Great tip and easy to follow.
Wow this works after reading other countless article. Thanks for the tips.
That was amazing!! I’m blown away!! I’ve been tryign to fix this issue for a REEEEAALY lomg time!!! THANKS!!!!!!!!!!
I L O V E Y O U ! ! !
I’ve been dealing with this problem for three years now…
Wonderful. Thank you very much for this.
Thank you, I appreciate this 🙂
Thank you so muuuuch! I’ve downloaded many programs but none of them worked! Thank yooou so much for this
Thanks so much, this actually works. Tried so many other ways of doing this and they all dont work.
You need to type “%userprofile%” exactly like that (without the quotes obviously). Dont put in your actual user name.
supercool.
This worked to fix the normal icons view of my c: drive and cd drive.
I think this has worked! Many thanks indeed, you do a great service to hapless Windows suffers (and who is not?).
Thanks I installed a theme and even after uninstalling it it left the icons behind. This fixed it
Worked a treat. Thank you.
All others failed. Your works! Thanks!!!
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.
Thankyou so much! All my Steam icons decided to disappear. This restored. Cheers.
Exact same scenario here! About half my game and application shortcuts became a globe or a piece of paper and running this script, even with windows 11 not being able to shut down explorer “gracefully”, and instead shutting it down with the script prompts worked flawlessly!
Thanks, works perfect! 🙂
This was very helpful, thank you for taking the time to post this.
Your a wizard Ramesh.
THIS IS THE ABSOLUTELY the right answer …
Taskbar Icons did not match the application…
It worked! Thanks a million! =)
Thank you very much for this answer to my problem
OhMyGawd Thanks so much dude!!
thanks you so much!! i was here for Steam Icon problem and it solved <3
Thanks! Worked perfectly.
Excellent solution path ! Outstanding – thanks a million !
Thanks a lot. Worked on Windows 7.
After “del iconcache.db /a” you can enter “explorer” in the same window to be even faster!
Thank you Ramesh!
Thanks you very much!
It worked. Thank you very much.
That worked great! Thank you.
worked great. good tip. thank you
Excellent tip
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.
worked for me – took about 1 minute to fix
Wow ! That’s Great . . . It really worked amazingly. . . Try it and chill. . .
Worked perfect, thank you 🙂
Thanks Leo! It worked great. Still would like to know what has caused this…
I had a corrupt icon for MSI Afterburner 2.3.1. This fixed the issue.
I have Vista and the above directions did not work. the cmds that i was to type “one by one” was not recognized..
Totally worked for what I needed. Thanks!
Worked like a charm..also fix other patchy missing icons… Thank you
Awesome! Lost Outlook 2010 icon in task bar bizarrely – followed your instructions and ‘boom’, icon appeared. Cheers!
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!
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
worked like a charm! always nice when that happens. Thanks!
As Mike said, it absolutely does work like a charm. Thanks so much, the bad Outlook icon has been bugging me for months!
HOLY CRAP THIS WORKS. I had locks on my folders for some reason, now all the locks are gone. THANK YOU SOOO MUCH!!!!!!!
THIS WORKED 100%
My Adobe Photoshop CS6 Icon was missing, and this helped me to restore it again. Simple steps and no risks!
BINGO!!!
Many thanks
didn’t work for me, maybe because i have roaming profile?
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
This is great! Thanks!!
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!!
It works like a charm. Thanks!
It really worked. Thank you !!
It dosen’t work in my case. Still the icons are remain as it is……….. 🙁
Please some one tel me the solution
Worked Great! Thanks
This worked for me, thanks alot!
Worked for me. Thanks a lot.
Worked Great! Thanks a lot.
Worked great, thumbs up!
Wow, works great! Is there a book that describes fixes like this somewhere? How can anyone possibly know all this stuff?
Wow Thanks! Worked like a charm! You’re awesome!
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!
It works like a charm! Many thanks.
All Hail Ramesh Srinivasan
You are a life saver man… Can’t thank you enough
Thank you Thank you
This didn’t help. I have Windows 7 – 64 bit
Worked for me. Thank you!
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.
Worked great! Thank you so much.
Worked great thanks! win7 64bit
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.
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
Amazing solution. Thank you so much. This solution is applicable for Windows 7 64 bit too.
Worked great! Thanks a lot
It worked, Thanks.
Thanks, worked perfectly.
Awesome! Worked like a charm.
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
Thanks that worked and I feel like a computer genius now! lol
Thanks Master.
You have me once situation.
Piseth
THANK’S DEAR 🙂
Worked. Thank you so much!
Oh hell yes this worked. When you’re typing the commands make sure to actually type %userprofile% and not your actual profile name
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!
Freakin’ Genius :D. Thanks
Worked!! Thanks….
Great! only one of my icons was blank and it was driving me nuts
Everything works until I get to DEL IconCache.db /a
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.
This is the ONLY thing that worked for me. All the other advice was useless. Thank you so much!
Thank you so much
you are really very smart
all my respects to you 😀
Beautiful work!! Thank you!
Clearing the icon caches didn’t solve this problem for me. However, when I manually created a new shortcut to the exe file, it used the right icon.
I didn’t even need to delete the old one and replace it with the new one – creating the new shortcut fixed them both, presumably by forcing Windows to reexamine the exe and updates its cache.
I tried the second and the third solution but nothing worked. I had the problem after upgrading from 8.1 to 10. Your vbs said the job is done successfully but I still had missing icons. This is how I fixed:
– I added in the register HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer a string key called “Max Cached Icons” and set it to 8192, then restarted my pc
– I login with another existing account (if you don’t have one then create) and I can see all icons. Then simply I copy & paste from the 2 directories (drag & drop files from “C:\Users\GoogUser\AppData\Local\Microsoft\Windows\Explorer” to “C:\Users\BadUser\AppData\Local\Microsoft\Windows\Explorer”). I got errors during copy (that’s why I tried using explorer and not shell) but I was lucky and good files were copied.
For my PC, I think the problem was “iconcache_256.db”. This file was 1 Kb on bad user and 5120 Kb on good user. Other files have the same size. Copying this file solved my problem and I can soon see the icons, without rebooting the PC or restarting explorer.exe
2nd method did it well, thanks.