Hellbovine
Well-Known Member
This guide is a work in progress that I have not been able to fully figure out yet. I have researched and tested everything I could think of regarding these cache files, and wanted to share what I came up with, to see if anyone else can find information on the parts I am missing. This main post will be updated as more people reply to the thread or whenever I make additional discoveries as I work on other projects.
THUMBS.DB
THUMBCACHE_*.DB
ICONCACHE.DB
ICONCACHE_*.DB
WHAT DO THEY DO?
CACHE CLEARING SCRIPT
THUMBS.DB
There used to be thumbs.db files which were hidden cache files stored inside folders that had pictures in them. Starting with Vista this changed, and thumbs.db are no longer used. As such, if you have these files on your computer in any newer Windows, it is because they were copy and pasted when you brought over folders from older computers, and those cache files were still inside. There is one exception, if you have a network share it will store a thumbs.db file there.
These files can be safely deleted, and will rebuild as needed on older operating systems. There used to be registry keys that would prevent these specific files from being created, but they are no longer relevant for reasons stated previously.
If you are using a network share, the following key may disable the creation of thumbs.db, but I have not tested it because I do not use a network share, nor do they exist in a clean install of Windows.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"DisableThumbnailsOnNetworkFolders"=dword:00000001
These files can be safely deleted, and will rebuild as needed on older operating systems. There used to be registry keys that would prevent these specific files from being created, but they are no longer relevant for reasons stated previously.
If you are using a network share, the following key may disable the creation of thumbs.db, but I have not tested it because I do not use a network share, nor do they exist in a clean install of Windows.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\Explorer]
"DisableThumbnailsOnNetworkFolders"=dword:00000001
THUMBCACHE_*.DB
These files exist at %localappdata%\Microsoft\Windows\Explorer\ and there are 15 of them in total. This appears to be where the newer operating systems now store thumbnails in cache, instead of in individual folders with the actual pictures they serve. I am assuming (since it is not documented) that each file has a specific purpose, directly related to its filename.
For example, thumbcache_1920 probably stores all the thumbnail data for images that are 1920x resolution. You can see how that would work out with the other file names too. I also sort of verified this in my testing, but I was not explicitly trying to figure this out, it was just something I noticed, where it would seemingly update the filename relating to what size the pictures were in the folder I was testing.
These files can be safely deleted and will rebuild as needed. At this time there is no known way to disable the creation of these files.
For example, thumbcache_1920 probably stores all the thumbnail data for images that are 1920x resolution. You can see how that would work out with the other file names too. I also sort of verified this in my testing, but I was not explicitly trying to figure this out, it was just something I noticed, where it would seemingly update the filename relating to what size the pictures were in the folder I was testing.
These files can be safely deleted and will rebuild as needed. At this time there is no known way to disable the creation of these files.
ICONCACHE.DB
The IconCache.db file is stored at %localappdata%\IconCache.db and can be deleted in order to fix corrupted icons found in Windows. This happens because at times the handle gets stuck and does not unload properly, then the file gets corrupted when it tries to update.
This file can be safely deleted and will rebuild as needed. There is a registry key to change the maximum size of the IconCache.db so that it can store more, since it is set to a fairly low value by default, depending on the operating system being used. Changing the key to a higher value seems to help alleviate the corruption issue, or perhaps just prolonging it before users come across the issue again.
Windows tries to delete and create a new IconCache.db when it reaches maximum size, I theorize that increasing the registry key value makes it take longer to see corruption because the file is then rebuilding itself less often, and thus less prone to bugs. The registry key value is in kilobytes, so a value of 4096 would be 4 MB. Setting a value of zero does not disable it, and instead likely means unlimited size.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]
"Max Cached Icons"="4096"
Something many people do not know, is that Windows is loading different kinds of cache into memory every reboot, and it is actively consuming memory at all times or during specific scenarios, depending on the feature being discussed. For example, if you set this registry key to 100 MB, and managed to fill it up, your task manager resource usage would be higher than someone using the default value. Wallpapers loaded onto your desktop also consume memory in similarly, and though these things are minimal there are enough nowadays that they noticeably add up.
This file can be safely deleted and will rebuild as needed. There is a registry key to change the maximum size of the IconCache.db so that it can store more, since it is set to a fairly low value by default, depending on the operating system being used. Changing the key to a higher value seems to help alleviate the corruption issue, or perhaps just prolonging it before users come across the issue again.
Windows tries to delete and create a new IconCache.db when it reaches maximum size, I theorize that increasing the registry key value makes it take longer to see corruption because the file is then rebuilding itself less often, and thus less prone to bugs. The registry key value is in kilobytes, so a value of 4096 would be 4 MB. Setting a value of zero does not disable it, and instead likely means unlimited size.
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]
"Max Cached Icons"="4096"
Something many people do not know, is that Windows is loading different kinds of cache into memory every reboot, and it is actively consuming memory at all times or during specific scenarios, depending on the feature being discussed. For example, if you set this registry key to 100 MB, and managed to fill it up, your task manager resource usage would be higher than someone using the default value. Wallpapers loaded onto your desktop also consume memory in similarly, and though these things are minimal there are enough nowadays that they noticeably add up.
ICONCACHE_*.DB
These files seem to be treated identically in every way as the thumbcache_*.db files are, except these files apply to icons and not pictures.
WHAT DO THEY DO?
The point of these cache files is the same as Indexing, Prefetch, Superfetch, Font caching, etcetera. They are supposed to help speed up loading of thumbnails and icon pictures. Whether they actually achieve this concept in reality is questionable at best.
I have never found a benefit to any of these "preloading" or "predictive" features on any kind of hardware. In fact, the opposite is true for me over the years, and I have found that they only cause problems or have the potential to (there have been documented bugs and memory leaks in Indexer and Superfetch for example), or the benefits they offer just don't outweigh the overhead they utilize.
The issues with the icon corruption are well documented on the web, since that bug occurs frequently for users. Microsoft even has some official documentation on it, and there was more that existed, but Microsoft has actively been deleting tons of links from their site, and updating older support articles as well, so now many articles have been lost to time. Here are some (link1, link2) that still exist though.
I think by doing away with the non-network thumbs.db files and then also integrating the user profile hive cleanup (UPH) into Windows, Microsoft hoped the corruption would go away, since the UPH service helps release handles at reboot, but the problem persists.
I have never found a benefit to any of these "preloading" or "predictive" features on any kind of hardware. In fact, the opposite is true for me over the years, and I have found that they only cause problems or have the potential to (there have been documented bugs and memory leaks in Indexer and Superfetch for example), or the benefits they offer just don't outweigh the overhead they utilize.
The issues with the icon corruption are well documented on the web, since that bug occurs frequently for users. Microsoft even has some official documentation on it, and there was more that existed, but Microsoft has actively been deleting tons of links from their site, and updating older support articles as well, so now many articles have been lost to time. Here are some (link1, link2) that still exist though.
I think by doing away with the non-network thumbs.db files and then also integrating the user profile hive cleanup (UPH) into Windows, Microsoft hoped the corruption would go away, since the UPH service helps release handles at reboot, but the problem persists.
CACHE CLEARING SCRIPT
If you want to delete all these files without using a third party tool or manually doing it, you can use the batch file below to do so. Just be sure to run it as an administrator. You can also use it for testing purposes like I did to delete the cache files, reboot, and see if they come back. If you also create a shortcut on your desktop that points to the filepaths of these things it acts as a quick way to check on them after a reboot.
@ECHO OFF
ECHO STOPPING EXPLORER.EXE AND DELETING ICON/THUMBNAIL CACHES
taskkill /f /im explorer.exe
TIMEOUT 3
del /f /q /a %localappdata%\IconCache.db
del /f /s /q /a %localappdata%\Microsoft\Windows\Explorer\iconcache_*.db
del /f /s /q /a %localappdata%\Microsoft\Windows\Explorer\thumbcache_*.db
shutdown -r -t 3
EXIT
Note: To create a batch file, open Windows notepad and copy the script into it, go to "save as" and label it "Clear_Cache.bat" without quotes, then in the "Save as type" bar at the very bottom change it from "Text Documents" into "All Files" then save it, and exit notepad.
@ECHO OFF
ECHO STOPPING EXPLORER.EXE AND DELETING ICON/THUMBNAIL CACHES
taskkill /f /im explorer.exe
TIMEOUT 3
del /f /q /a %localappdata%\IconCache.db
del /f /s /q /a %localappdata%\Microsoft\Windows\Explorer\iconcache_*.db
del /f /s /q /a %localappdata%\Microsoft\Windows\Explorer\thumbcache_*.db
shutdown -r -t 3
EXIT
Note: To create a batch file, open Windows notepad and copy the script into it, go to "save as" and label it "Clear_Cache.bat" without quotes, then in the "Save as type" bar at the very bottom change it from "Text Documents" into "All Files" then save it, and exit notepad.
Last edited: