The icons that display for files in Windows are saved in an icon cache so they can be displayed quickly instead of having to manually scan and slowly load them each time.
The icon cache can sometimes become corrupted causing the icons of files to display incorrectly or distorted. When this happens, the icon cache needs to be deleted to reset and automatically recreate it.
Rebuilding the icon cache will not help with the following icon issues:
- The icon of a shortcut not displaying properly due to the target source of the shortcut was moved or deleted. You may need to recreate a new shortcut directly from the source (ex: program's exe) file to replace it instead.
- All icons for a specific file extension display the wrong icon. This may be due to setting the wrong association for what app to open the file type instead. If so, restoring the default association of the file extension will fix this issue.
- Thumbnails of pictures, videos, and documents.
Contents
- Option One: Refresh Icons using Command
- Option Two: Rebuild Icon Cache using BAT file
- Option Three: Rebuild Icon Cache in Command Prompt
OPTION ONE
Refresh Icons using Command
1 Open Windows Terminal, and select either Windows PowerShell or Command Prompt.
2 Copy and paste the
ie4uinit.exe -show
command into Windows Terminal, and press Enter. (see screenshot below)3 If the refresh doesn't sort the icons, you can try Option Two or Option Three.
OPTION TWO
Rebuild Icon Cache using BAT file
1 Click/tap on the download button below to download the BAt file below.
Rebuild_Icon_Cache.bat
(Content of BAT file for reference)
Code:
@echo off
set iconcache=%localappdata%\IconCache.db
set iconcache_x=%localappdata%\Microsoft\Windows\Explorer\iconcache*
echo.
echo The explorer process must be temporarily killed before deleting the IconCache.db file.
echo.
echo Please SAVE ALL OPEN WORK before continuing.
echo.
pause
echo.
If exist "%iconcache%" goto delete
echo.
echo The %localappdata%\IconCache.db file has already been deleted.
echo.
If exist "%iconcache_x%" goto delete
echo.
echo The %localappdata%\Microsoft\Windows\Explorer\IconCache_*.db files have already been deleted.
echo.
exit /B
:delete
echo.
echo Attempting to delete IconCache.db files...
echo.
ie4uinit.exe -show
taskkill /IM explorer.exe /F
If exist del /A /F /Q "%iconcache%"
If exist del /A /F /Q "%iconcache_x%"
start explorer.exe
echo.
echo IconCache database files have been successfully deleted.
goto restart
:restart
echo.
echo.
echo You will need to restart the PC to finish rebuilding your icon cache.
echo.
CHOICE /C:YN /M "Do you want to restart the PC now?"
IF ERRORLEVEL 2 goto no
IF ERRORLEVEL 1 goto yes
:yes
shutdown /r /f /t 00
:no
exit /B
2 Save the BAT file to your desktop.
3 Save and close anything that you are working on before proceeding. The next steps will involve killing the explorer process and restarting the PC.
4 Unblock and run the BAT file.
5 Follow the instructions in the command prompt to rebuild the icon cache. If you do not restart the PC now, you will need to later to finish rebuilding the icon cache. (see screenshot below)
6 If the icons are still not displaying properly after rebuilding the icon cache, then download and merge the .reg file for the .ico (ICO) option here to restore the default associations of .ico (icon) files in Windows.
OPTION THREE
Rebuild Icon Cache in Command Prompt
1 Close and save anything that you are working on before proceeding. The next steps will involve killing explorer and restarting the PC.
2 Open Windows Terminal, and select Command Prompt.
3 Copy and paste each command below one at a time into Windows Terminal, and press Enter after each command.
ie4uinit.exe -show
taskkill /IM explorer.exe /F
DEL /A /Q "%localappdata%\IconCache.db"
DEL /A /F /Q "%localappdata%\Microsoft\Windows\Explorer\iconcache*"
shutdown /r /f /t 00
The last command will instantly restart the computer.
4 If the icons are still not displaying properly after rebuilding the icon cache, then download and merge the .reg file for the .ico (ICO) option here to restore the default associations of .ico (icon) files in Windows.
That's it,
Shawn Brink
Attachments
Last edited: