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
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

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.

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.

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.

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.
 
Last edited:
Nice, thanks.

Let me know if you see some potential of automation here, to add to the tool.
The DisableThumbnailsOnNetworkFolders is in already ("Display icons instead of thumbnails on network folders"), and will add all the file paths to the Cache and temp files component.

Edit: checked and the Cache component was already removing the entire %localappdata%\Microsoft\Windows\Explorer folder content, it's all cache, some unrelated to this topic.
 
Last edited:
"Max Cached Icons"="0"

Here doesnt prevent re-creating of IconCache.db. Win7 x64.

I have two entries, one the above mentioned, second in Wow6432Node. Of course I zeroed them both.
 
On a clean install of W10 21H2, the registry key is hidden and has to be added. Since you had it in two locations I'm guessing Microsoft must have changed the key a bit over time?
 
Last edited:
All OS's can be different, ie Explorer.exe. On W7 its in c;/windows, garlin says its c;/windows/system32. I did mention that this ico cache thing may vary between OS's. I took the original entry straight from winaero-tweaker with regfromapp, it didnt have a Wow6432Node entry, if it had i would have posted it.

Ive been running the icon cache at 51.2MB(without the Wow6432Node entry) for over a year without problem.
Code:
[HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer]
"Max Cached Icons"="51200"
 
Last edited:
The Wow6432Node key I might have created myself, I often trace booting and other things with ProcMon, so I determined it was querying it.
 
MacVap, is it possible that you incorporated this registry key into your image? The reason I ask, is maybe it's sitting in HKEY_USERS\.DEFAULT\ and so that's why the IconCache.db created itself again.
 
Last edited:
This is a live install from a long time ago. I know about the registry key since XP times and played around with it a lot, I determined that for my needs 4096 is enough/works well.

The Wow6432Node key, as I said, I must have created myself because I have seen that some program asks for it. Disregard it, I shouldn't have mentioned it. But as a side note, I always modify them together to a same value, so there is no confusion.
 
No problems with icon cache set to zero except windows keeps creating a new iconcache.db file upon reboot.
Doesnt rebuild with system running(yet), only on boot/restart.
 
Found an app icon cache on w10 1809 - Administrator\AppData\Local\Packages\Microsoft.Windows.Cortana_cw5n1h2txyewy\LocalState\AppIconCache\100. 51 files = 1.8MB
 
Clanger beat me to it. Last night after doing more follow-up testing due to MacVap's report, it turns out that a value of zero for the registry key does not disable it. Here is what I found, and why my initial assessment wasn't correct.

I set the value to zero, then ran the .bat file to clear the caches and files then rebooted. Those 30 cache files will create themselves again as soon as you hit the desktop after the reboot, but IconCache.db did not. I then tried testing different methods to force the IconCache.db file to rebuild, such as refreshing the desktop, changing a shortcut's icon, I created a custom folder with icons in it to refresh, tried changing the folder "view" settings between all 8 options, then I tried launching an app, and nothing would cause it to rebuild.

However, if you just reboot again (a second time), that's when the IconCache.db rebuilds itself. So based on the tests and by monitoring the timestamps on these cache files, I theorize what's happening is that IconCache.db probably draws from those 15 iconcache_*.db files to build itself at shutdown, which is why it doesn't rebuild while the system is live. The reason it doesn't automatically rebuild itself on the first shutdown is because it doesn't have the other files to pull data from since those were deleted by the .bat file before the first shutdown.

This probably means that a value of 0 for the Max Cached Icons registry key in this case is "unlimited megabytes" and does not disable these files. For example, in the power plan a max CPU value set to 0 actually means "unlimited" speed, it doesn't mean disable throttling.

I'll update the original post to account for this. Sorry guys, looks like we're back to square one again with this thing.
 
Last edited:
Got to be a hidden value in a hive, user key, or summat like this "disableiconcache = 0". That or we are FoL.
Back to 51.2MB.
 
How about a value of "-"?
Or any value that will cause it to brain fart?,,,,,,
Or to an unavailible location?
 
Last edited:
I'm not going to give up, I'll keep this on my to-do list to keep revisiting. I think almost everything pertinent is in the registry even if it's just hidden. For example, on Windows 10 Home 21H2 there's over 1.9 million lines of registry, and that's just what's visible to us. The tweaks exist, it's just a matter of finding them in all of this hidden and undocumented stuff that is difficult.
 
Last edited:
Not for me it isnt, stopping icon caching was never the goal, increasing the icon cache size to stop icons being borked was.
zero - unlimited or 51.2mb, either way im happy.
Part of my goal is to stop winblows constantly overwriting stuff so deleting that cache file works against that. Im still quids in.

How big is 51.2MB anyway? Two mp3 podcasts or 3 minutes of cd quality wav file.
 
Last edited:
Back
Top