This tutorial demonstrates how to rebuild the icon cache in Windows 10 and Windows 11. Instructions are provided for using the Command Prompt, and a batch script is also included for automating the process.
While the caching of icons in Windows assists with performance, if this cache is corrupted, it can lead to the display of incorrect or corrupted/distorted icons, or icons missing or otherwise not being displayed. Rebuilding the icon cache by deleting it (after which it will automatically regenerate) can resolve these issues.
How to rebuild the icon cache using the Command Prompt in Windows 10 and Windows 11
To delete the icon cache using the Command Prompt in Windows 10 and Windows 11, follow these instructions.
Before you begin, you should ensure all of your open files are saved and applications are closed. You should also perform a full system backup before running any commands you find on the internet. Then, open the Command Prompt from the Start menu, or right-click on the Start button and select Run, then type the command cmd.exe in the Run dialog and press OK.
Next, enter the following commands in the Command Prompt (enter each line as a separate command) in the order displayed:
taskkill /IM explorer.exe /F
DEL /A /F /Q “%localappdata%\IconCache.db”
DEL /A /F /Q “%localappdata%\Microsoft\Windows\Explorer\iconcache*”
DEL /F /S /Q “%localappdata%\Packages\Microsoft.Windows.Search_cw5n1h2txyewy\localstate\AppIconCache*.*”
These commands will force stop the explore.exe process, and then delete the icon cache files. Once your device is rebooted, the cache will be regenerated.
Run the following command when you are ready to restart your PC:
shutdown /R /F /T 00
Alternatively, you can relaunch Windows Explorer by pressing Ctrl+Shift+Escape to open the Task Manager and selecting File > Run new task, then entering explorer.exe and pressing OK – however, rebooting is usually the easier method.
These commands should work on all versions of Windows 10/11, including Home, Pro, Enterprise, and Education editions. It is necessary to be logged in as an administrator to perform these steps.
If icons are still displaying incorrectly after you have rebuilt the icon cache, consider resetting file associations to their defaults, so the correct application is assigned to each file type.
Rebuild the Windows icon cache by using a batch file in Windows 10 and Windows 11
If you wish to create a shortcut to deleting and regenerating the Windows icon cache, you can copy and paste the below script into a new Notepad file:
@echo off
echo.
echo Killing the Windows Explorer process
taskkill /IM explorer.exe /F
echo.
echo Deleting the Icon Cache
DEL /A /F /Q “%localappdata%\IconCache.db”
DEL /A /F /Q “%localappdata%\Microsoft\Windows\Explorer\iconcache*”
DEL /F /S /Q “%localappdata%\Packages\Microsoft.Windows.Search_cw5n1h2txyewy\localstate\AppIconCache*.*”
echo.
echo Restarting the Windows Explorer process
start explorer.exe
echo.
echo The icon cache has been deleted and will be regenerated. It is recommended to reboot your device.
pause
Save this file with the .bat extension (for example clear_icon_cache.bat) to create a batch file. You can then run this script whenever you want to rebuild the Windows icon cache. As mentioned above, be sure to save all of your work and close any open applications before you do so.
Diagnosing and fixing Windows issues in enterprise environments and for remote workers
Diagnosing and resolving frustrating Windows issues (such as corrupted and missing icons by rebuilding the icon cache) is a routine task for IT support teams. Remote Access by NinjaOne streamlines this process by allowing you to initiate remote access connections directly from support tickets – reducing the time it takes to resolve small support issues so you can focus on maintaining the reliability and security of your wider IT infrastructure.
With NinjaOne, you can access managed and unmanaged devices from both your own desktop or mobile devices, allowing you to assist users from anywhere. You can also initiate file transfers, launch remote terminal windows, and chat with users to ensure that support tickets are always solved in as little time as possible.
FAQ
Why does the icon cache become corrupted?
Windows operating system crashes, unexpected power loss, software conflicts, and even data corruption due to hardware issues can cause the icon cache to become corrupted.
Will rebuilding the icon cache affect other files or personal data?
No, the above commands will only affect the icon cache. However, it is recommended that you create regular backups of your system in case of a typo in a command that leads to unexpected file deletion.
How often should I rebuild the Windows icon cache?
It is only necessary to rebuild the Windows icon cache when you are experiencing problems.
Does rebuilding the Windows icon cache fix thumbnail display issues?
Thumbnails are managed separately from icons. Rebuilding the icon cache will not affect thumbnails.