This article was primarily written around Win 7, Vista, and XP. However, it also applies to Win ME & 95/98 except that the hidden icon cache file for these is named “ShellIconcache” instead of “IconCache.db” and has a different location (C:\Windows).
About the Icon Cache
Windows is constantly collecting new icon information in RAM to add to the icon cache. This is to ensure that in future the icons can be formed more quickly. Speed is important because there are thousands of icons stored in a computer, which would slow down the system if there were not cached. As new icons are uncovered a small delay is sometimes seen – hardly noticeable for a few very small icons. If there has been sufficient change, the latest information is stored in the IconCache.db file as you log off (or shutdown). This updated file is used during reboot. It is the “users” IconCache.db file that is of prime interest, and for Win7 and Vista it is located in “C:\Users\AppData\Local”. For XP it is in “C:\Documents and Settings\Local Settings\Application Data”. Files and folders need to be unhidden in order to view these locations and the file itself.
When there is a dramatic change (such as playing a game with vastly different screen settings), this new information is collected and can overwrite the previous information held in RAM. When you go back to normal Windows settings the usual icons can then take a noticeable time to appear. It can sometimes take several reboots before the system and the file correlate sufficiently before all icons appear normal again. This is because as you open folders, further icon information is collected, which is subsequently included in the next new IconCache.db file. The latter therefore grows in size over time. [In Windows 9x you could open the ShellIconCache file in a text editor and see which icons were being stored].
Icons Loading Slowly
If the icons in some folders become slow to build, then open as many of your frequently used folders as you can. Wait each time for all the correct icons to appear before moving on, thus storing the new information in RAM. An updated IconCache.db file should be available on reboot and rectify the problem. If you have more serious or persistent icon issues then the simplest remedy is to first follow the above process, but then delete the IconCache.db file and force Windows to use a brand new copy on reboot. The next reboot will be a little slower (HD light flashing) while the base information is passed to RAM from the replacement IconCache.db file. Further improvement will continue with time.
Manually Rebuilding the Icon Cache
Note that there are many ways to force the IconCache.db file to rebuild after reboot, such as changing display settings, or going from Safe Mode to Normal mode, or temporarily binning “your own desktop shortcuts” then restoring them from the bin after reboot. The last one is the least disruptive to the icon cache, yet is very effective. If you have a severe icon problem, deleting the IconCache.db file and applying the following registry fix is the best way forward.
If you have a large number of programs and files then it is worth using an appropriate registry fix (available on the internet) to increase the cache size from its default of 500. The small increase in RAM usage is usually well worthwhile. For those who are happy in the registry it is necessary to add a new “string” value here:
“HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\explorer”
If, for example, you want to increase it to the MS suggested maximum, then create a new string entry named Max Cached Icons (three words) and give it a value of 4096. So far I have found no real benefit in increasing it further, although some downloaded fixes do so. With time the IconCache.db file will get larger as a consequence of this increased allowance and the icon situation will become more stable.
Common Myths
Having undertaken careful research, I note that there is some incorrect or dubious information repeated on technical websites, as follows.
The name of the previously mentioned registry entry is sometimes misquoted without the two spaces, and “DWORD” wrongly suggested instead of “STRING” (even from Microsoft). These have to be entered as already given in order to produce the larger cache.
The IconCache.db file is rarely “corrupted” as is often stated. Usually it is simply out of date with the current situation or needs to be made larger, as already explained.
Some websites imply that the IconCache.db file is produced or modified (somehow) when Windows starts. This is not the case – the file is produced when logging off is initiated.
Finally, It is sometimes said that you can restore a “deleted” IconCache.db file by opening and closing explorer.exe (Windows Explorer) by either using Task Manager or a script. This is not the case for XP, although it might “initiate” the process. The only certain ways to restore the physical file if deleted are either by switching users or restarting the computer.