- How to Clear and Rebuild the Icon Cache Completely in Windows
- Clear icon cache completely in Windows
- How to Clear and Rebuild the Icon Cache in Windows
- Method 1: Clear & Rebuild icon cache using ClearIconCache.exe freeware tool
- Method 2: Clear & Rebuild the Icon Cache Database Manually
- Method 3: Automatically Clear & Rebuild the Icon Cache Using Script
- How to rebuild Windows Icon Cache without closing explorer.exe or restarting Windows?
- Attempts
- Question
- Rebuild Icon Cache, Clear Thumbnail cache in Windows 10
- Rebuild Icon Cache in Windows 10
- Clear Thumbnail cache in Windows 10
- Purge & rebuild the Icon Cache in Windows 8/7
- Rebuild The Icon Cache
- How to Rebuild Broken Icon Cache in Windows
- Rebuild the Icon Cache in Windows 7
- Rebuild Icon Cache in Windows 8 and 10
How to Clear and Rebuild the Icon Cache Completely 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 the icon cache database. This post explains how to completely clear the icon cache (and let Windows rebuild it), using a specialized tool, or with a script I wrote, or manually — for all versions of Windows, including Windows 10.
Clear icon cache completely in Windows
How to Clear and Rebuild the Icon Cache in Windows
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.
If refreshing the icons using ie4uinit.exe or Default apps doesn’t help, you’ll have to completely clear the icon cache.
Let’s see how to clear the icon cache completely, and let Windows rebuild it as and when it requires.
Method 1: Clear & Rebuild icon cache using ClearIconCache.exe freeware tool
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 wrote the famous PDF x64 thumbnail & preview fix for Windows few years back. And, he’s the owner of FileTypeDiag and many other useful portable tools.
With Clear Icon Cache, you just 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.
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.
Method 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:
- 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.
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…)
Editor’s note: Instead of using Task Manager to exit Explorer.exe in Step 3 above, 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. If you’re using Windows 8 or Windows 10, check the article How to Exit Explorer and Restart Explorer in Windows 10.
Method 3: Automatically Clear & Rebuild the Icon Cache Using Script
This first method uses a small script that I wrote to clean up the icon cache completely. Once done, the script restarts Explorer shell for the change to take effect.
To clear the icon caches for Windows Vista, 7, 8 and Windows 10, download the zip file below, unzip and run the script file cleariconcache.vbs.
- Download cleariconcache.zip and extract the contents to a folder.
- 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.
If the Icon Cache database files can’t be deleted, some programs are using it. Close all applications and try running the script again.
Once you close all programs, the program should be able to delete the icon cache files.
After clearing the cache, Explorer shell should start automatically, and rebuilds a fresh set of icon cache.
Hope you were able to fix icon rendering issues on your Windows computer by clearing the icon cache completely.
How to rebuild Windows Icon Cache without closing explorer.exe or restarting Windows?
I am trying to customise a folder icon from within my Application but due to the way Windows caches icons and thumbnails I am struggling to get the changed folder to update it’s new icon.
In Windows there are two ways that I know of to customise a folders icon, the simplest way is to right click the folder from Windows Explorer, Properties and then select the Customize tab and change its icon, this method is no good though as it requires manually changing the folder properties.
The second way which I am doing from my program is to create a desktop.ini file and place it inside the folder that requires the icon changing, documentation on desktop.ini can be found here: http://hwiegman.home.xs4all.nl/desktopini.html and an article here: http://helpdeskgeek.com/how-to/customize-folder-icons-desktop-ini/
As shown below though, the folder icon in Windows is not updated although you can see from the folder properties that the icon has changed, just Windows is not showing the updated folder icon:
I am fully aware of Windows caching icons and thumbnails, I have searched and read several pages on ways to supposedly rebuild the icon cache and thus get Windows to display the newly changed icon and not the cached one, however I am unable to get this to work from my Application without restarting Windows or the Explorer.exe process, this needs to be done without interrupting Windows though so closing Explorer.exe or requiring a restart is absolutely not an option.
Interestingly though, when changing a folder icon from the first way I described earlier, Windows somehow manages to flush and rebuild the icon cache as the changed folder is promptly updated to show the new icon, however I cannot see what tricks Windows does to achieve this.
Attempts
A few things I tried unsucessfully, (in no particular order):
- Executing the following: ie4uinit.exe -ClearIconCache
- Running this code in Lazarus: SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil);
- Deleting the IconCache.db file from AppData\Local
- Toggling the «Always show icons, never thumbnails» Explorer option from the registry, located here: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced which is stored in the IconsOnly value
- Changing the icon size from the registry and back, located here: HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics which is stored in the Shell Icon Size value
- This link provides an apparent solution in Delphi which I was unable to convert in Lazarus: http://www.aha-soft.com/faq/q18.htm
- I am aware of cached db files here: AppData\Local\Microsoft\Windows\Explorer although I am not sure if they are of any help, attempting to delete some of them does not seem possible as they may be locked etc.
- Renaming the folder and then rename back to original name.
- Right click an empty space in Windows Explorer and selecting Refresh does not seem to update the folder icon either.
Have also tried performing some of the above in combination with no luck.
Question
When changing a folder icon directly from Windows Explorer, using the properties context menu and customize tab, when applying and closing this dialog the folder icon is changed almost immediately, there is no closing explorer.exe or restarting Windows, the change happens very much right away.
How can I achieve this from my Application programmatically the same way Windows Explorer does? Is there a way to find out how Windows Explorer does this?
My Operating System is Windows 10 which could explain why some of the older methods don’t work for me.
Rebuild Icon Cache, Clear Thumbnail cache in Windows 10
If your icons appear blank or look corrupted or do not refresh correctly, when they should, then it is quite possible that your icon cache database may have become corrupted on your Windows 10 PC. The same thing applies to Thumbnails too. If they do not display correctly, then they may have become corrupted. In such a scenario, you may need to delete the cache files in order to rebuild the Icon cache and clear the Thumbnail cache.
This post will show you the location of these cache files so that you can delete IconCache.db and thumbcache .db files, in order to rebuild the Icon cache and clear the Thumbnail cache in Windows 10.
Rebuild Icon Cache in Windows 10
The Icon Cache or IconCache.db is a special database file that Windows utilizes to keep copies of each icon handy. When Windows needs to draw an icon, it uses the copy from the cache instead of retrieving the icon image from the original application file. This helps in making Windows draw the icons faster. Things were different in Windows XP, and they are different in Windows 7/8. Things changed again from Windows 8.1 onwards. In Windows 10, you need to do the following.
If you needed to rebuild the Icon Cache in Windows 7/8, you needed to do the following: Open File Explorer > Folder Options > Views to show Hidden System Files. Next, go to C:\Users\%username%\AppData\Local folder and delete the hidden IconCache.db file. Reboot. This action would purge and rebuild the icon cache.
But this is not enough in Windows 10 or Windows 8.1. You will have to navigate to the following folder:
Here you will see a lot of files like iconcache_32.db, iconcache_48. db , iconcache_96.db, iconcache_256.db, iconcache_1024.db, iconcache_1280.db, iconcache_1600. db , iconcache_1920.db, iconcache_2560. db , iconcache_exif.db, iconcache_idx.db, iconcache_sr. db , iconcache_wide.dd, iconcache_wide_alternate. db , etc.
Delete them all to purge and rebuild your icon cache in Windows 10. If you were to be able to delete some of them, you would now be able to see a new folder created named IconcacheToDelete, which will disappear when you reboot your computer or restart Windows File Explorer.
If you find that you are unable to delete these files, do the following.
First, close all open programs. Next, open Task Manager, look for the process Windows Explorer, right-click on it and select End process. Next, from the File menu > select Run new task. Type cmd .exe , check the Create this task with administrative privileges box and press Enter.
This will open an elevated command prompt window.
Now type the following commands one after the other and hit Enter:
This will rebuild your icon cache in Windows 10.
TIP: See how you can stop Windows 10 from deleting Thumbnail cache on every shutdown, restart or boot.
Clear Thumbnail cache in Windows 10
Windows Thumbnail cache or Thumbs.db files are hidden data-files in the Windows operating system, which contain small images, displayed when you view a folder in “thumbnail” view, as opposed to tile, icon, list, or detail view. Windows keeps a copy of all your pictures, video and document thumbnails so that they can be displayed quickly when you open a folder. In Windows XP you see these ‘hidden’ files thumbs. db files scattered all over the place. In Windows Vista and later, the thumbnails ‘thumbcache’ are stored at C:\Users\Owner\AppData\Local\Microsoft Windows\Explorer – which is the same where the icon cache files are stored.
If you want to delete and clear the Thumbnail cache, you will have to follow the same procedure as mentioned above, but finally, use these commands:
Please let us know if this worked for you and helped you resolve your problem.
Windows 10 users may want to use Thumbnail and Icon Cache Rebuilder, which lets you purge and rebuild Thumbnail & Icon Cache in a click.
If your desktop or explorer icons load slowly when they start the Windows PC, you may want to increase Icon Cache size and see if it helps you. This post will show you how you can stop Windows 10 from automatically deleting Thumbnail cache. See this post if your Desktops icons are slow to load.
Purge & rebuild the Icon Cache in Windows 8/7
If you find that one or more of your icons are not displaying correctly, or that your Icon Cache is corrupted, you might want to rebuild the Icon Cache. The Icon Cache or IconCache.db is a special database file that Windows utilizes to keep copies of each icon handy. When Windows needs to draw an icon, it uses the copy from the cache instead of retrieving the icon image from the original application file. This helps in making Windows draw the icons faster.
Rebuild The Icon Cache
In Windows 8, Windows 7 and Windows Vista, this IconCache.db file is located at:
Whereas, it is different in the older version of Windows i.e. Windows XP.
If you find your Windows displaying icons on the desktop in the wrong manner you can purge & rebuild the Icon Cache In Windows.
If you need to rebuild the Icon cache, Open File Explorer > Folder Options > Views to show Hidden System Files. Next, go to C:\Users\Username\AppData\Local folder and delete the hidden IconCache.db file. Reboot. This action will purge and rebuild the icon cache.
There is also another way to do it, should the above method not work for you.
Kill Explorer.exe process. In Windows 7, click Start button > Hold down Ctrl+Shift & Right Click on an empty area in the Start Menu > Click “Exit Explorer”. In Windows 8, you may do so via the Task Manager.
Open the command prompt window, type each of the following and after every command, hit the Enter button:
Your Windows Icon Cache would have been rebuilt.
You may also want to check out our freeware Icon Cache Rebuilder Tool to automate the entire process of repairing icon cache.
How to Rebuild Broken Icon Cache in Windows
Almost every file and program on your Windows system will have its own icons. As you can tell, these icons allow you to quickly recognize the applications, file types, and settings on your Windows system. Typically, Windows caches all those icons so that it can display them faster without needing to grab the icon from the target program each and every time. As useful as it is, the icon cache can sometimes get corrupted which results in broken icons for some applications and settings. In those situations, rebuilding the icon cache might help. Here is how to rebuild the I con cache in Windows 7, 8 and 10.
Note: rebuilding the I con cache is a bit different for Windows 7 and Windows 8/10. Follow the steps depending on your Windows version.
Rebuild the Icon Cache in Windows 7
In Windows 7 the system stores a database of all the icons in a single file called “IconCache.db.” By deleting this file, Windows will automatically rebuild the icon cache.
To start, press “Win + R,” enter the follow path while replacing “Username” with your actual username and press the Enter button.
The icon cache file is hidden by default; you need to unhide it before you can delete it. To do that, select the option “Folder Options” from the “Tools” menu.
Once the Folder Options window has been opened, navigate to the “View” tab, select the option “Show hidden files, folders, and drives,” and then click on the “Ok” button to save the changes.
This action will reveal the “IconCache.db” file. Simply select the file and delete it using the Delete key on your keyboard.
After deleting the file, you need to restart the Explorer to see the changes. To do that, open the Task Manager, navigate to the “Processes” tab, right-click on “explorer.exe” and then select the option “End Process.”
Now, navigate to the Applications tab and click on the “New Task” button.
Here in this window, enter “explorer.exe” and press the Enter button on your keyboard to start the new process. That’s all there is to do. You’ve successfully rebuilt the broken icon cache in Windows 7.
Rebuild Icon Cache in Windows 8 and 10
Though Windows 8 and 10 have the same “IconCache.db” file in the same location as in Windows 7, deleting the file won’t work. In Windows 8 and 10 there are several icon cache files located in a different location. Since there are several files to delete, we are going to use the Command Prompt approach as it makes things easier.
To start, press “Win + X” and then select the option “Command Prompt” from the list of options. Once the Command Prompt has been opened, execute the below command to navigate to the Explorer folder. Of course, replace “Username” with your actual username.
Once you are here you can use the dir command to see all the files in the directory.
Now, use the below command to delete all the icon cache files in one single step.
The above action will delete all the icon cache files. Now open the Task Manager, navigate to the Processes tab, right-click on the process “Windows Explorer” and select the option “Restart.”
This action will restart the Explorer, and Windows will automatically rebuild the icon cache.
That’s all there is to do. Do comment below sharing your thoughts and experiences about using the above methods to rebuild the icon cache in Windows 7, 8, and 10.
Vamsi is a tech and WordPress geek who enjoys writing how-to guides and messing with his computer and software in general. When not writing for MTE, he writes for he shares tips, tricks, and lifehacks on his own blog Stugon.