/
/

How to Rebuild the Icon Cache in Windows 10 and Windows 11

by Lauren Ballejos, IT Editorial Expert
How to Rebuild the Icon Cache in Windows 10 and Windows 11 blog banner image

Instant Summary

This NinjaOne blog post offers a comprehensive basic CMD commands list and deep dive into Windows commands with over 70 essential cmd commands for both beginners and advanced users. It explains practical command prompt commands for file management, directory navigation, network troubleshooting, disk operations, and automation with real examples to improve productivity. Whether you’re learning foundational cmd commands or mastering advanced Windows CLI tools, this guide helps you use the Command Prompt more effectively.

Key Points

  • The Windows icon cache stores thumbnail-sized icon images to improve display performance; when it becomes corrupted, icons may appear blank, incorrect, or go missing entirely.
  • There are four ways to rebuild the icon cache: via Command Prompt, File Explorer (GUI), PowerShell, or a single-command quick fix using ie4uinit.exe.
  • The ie4uinit.exe quick fix is the fastest method and does not require a reboot, making it a good first step before trying more involved approaches.
  • Rebuilding the icon cache only removes cache files and has no impact on your personal data, installed apps, or system settings.
  • If icons are still broken after rebuilding the cache, additional steps such as resetting file associations or running the System File Checker (SFC) may be required.

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.

Ease the complexities of resolving Windows endpoint issues with NinjaOne.

See what NinjaOne for Windows can do

At a glance

Short on time? No problem! Here’s a quick cheat sheet:

MethodTechnical levelReboot required?Best for
ie4uinit.exe Quick FixBeginnerNoFast first attempt
File Explorer (GUI)BeginnerYesNon-technical users
Command PromptIntermediateYesStandard fix
Batch FileIntermediateRecommendedRepeatable/automated
PowerShellAdvancedYesIT pros/sysadmins

How to rebuild the icon cache using the Command Prompt in Windows 10 and Windows 11

Before proceeding, take note of the following:

  • Save all open files and close any running applications before proceeding.
  • You must be logged in as an administrator to perform these steps.
  • It is recommended to perform a full system backup before running any commands found on the internet.
  • These steps apply to all editions of Windows 10 and Windows 11, including Home, Pro, Enterprise, and Education.

Method 1: Single-command quick fix (ie4uninit.exe)

The ie4uinit.exe -show command forces Windows to refresh icon associations and can resolve minor icon display issues without requiring a reboot. This is generally considered the first troubleshooting strategy to consider, especially if you’re only fixing one device.

  1. Open Command Prompt.
  2. Type the following command and press Enter.

ie4uinit.exe -show

  1. Wait a few seconds and check whether your icons have returned to normal.

Note: If the issue persists, proceed to one of the methods below.

Method 2: Using File Explorer (GUI)

  1. Open File Explorer, and select the View tab.
  2. Click Options > Change folder and search options
  3. In the View tab > Show hidden files, folders, and drives > Ok
  4. In the File Explorer, navigate to the following path: (Replace YourUsername with your actual Windows username)

C:\Users\YourUsername\AppData\Local

💡 Alternatively, you can paste %localappdata% directly into the File Explorer address bar and press Enter to go directly to this folder.

  1. Locate and delete the file named IconCache.db.

C:\Users\YourUsername\AppData\Local\Microsoft\Windows\Explorer

  1. Delete all files beginning with iconcache in this folder.
  2. Restart your computer. Windows will automatically regenerate the icon cache.
  3. Once done, you can re-hide system files by returning to the Folder Options and re-selecting Don’t show hidden files, folders, and drives.

Method 3: Using Command Prompt

Then,

  1. Open the Command Prompt from the Start menu, or right-click on the Start button and select Run.
  2. Type the command cmd.exe in the Run dialog and press OK.
  3. 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.

  1. Run the following command when you are ready to restart your PC:

shutdown /R /F /T 00

Alternatively, you can:

  1.  Relaunch Windows Explorer by pressing Ctrl+Shift+Escape to open the Task Manager
  2. Select File > Run new task, then enter explorer.exe and pressing OK

However, rebooting is usually the easier method.

Method 4: Using batch file

  1. Copy and paste the script below 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

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

Method 5: Using PowerShell

  1. Open PowerShell as an administrator.
  2. Run the following script:

# Stop Windows Explorer

Stop-Process -Name explorer -Force

# Delete icon cache files

Remove-Item "$env:LOCALAPPDATA\IconCache.db" -Force -ErrorAction SilentlyContinue

Remove-Item "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\iconcache*" -Force -ErrorAction SilentlyContinue

Remove-Item "$env:LOCALAPPDATA\Packages\Microsoft.Windows.Search_cw5n1h2txyewy\LocalState\AppIconCache*" -Recurse -Force -ErrorAction SilentlyContinue

# Restart Windows Explorer

Start-Process explorer

Write-Host "Icon cache cleared. Please reboot your device to complete the process." -ForegroundColor Green

```

  1. Once the script has run, reboot your device to allow the icon cache to fully regenerate. The `-ErrorAction SilentlyContinue` parameter ensures the script runs cleanly even if some cache files do not exist on the target machine.

Troubleshooting common issues

If your icons are still displaying incorrectly after rebuilding the icon cache, try the following steps:

1. Reset file associations

Incorrect file associations can cause the wrong icon to display for certain file types. Resetting file associations to their defaults ensures the correct application, and its corresponding icon, is assigned to each file type. This can be done via Settings > Apps > Default Apps.

2. Run the System File Checker (SFC)

Corrupted system files can sometimes cause persistent icon issues. Open Command Prompt as an administrator and run:

sfc /scannow

This will scan and attempt to repair any corrupted Windows system files.

3. Check for Windows Updates

Pending Windows Updates can occasionally cause display issues, including icon corruption. Navigate to Settings > Windows Update and ensure your system is fully up to date.

4. Clear the thumbnail cache

If you are experiencing broken thumbnail previews in File Explorer in addition to icon issues, you may also need to clear the thumbnail cache. This is a separate process from rebuilding the icon cache.

5. Perform a system restore

If the issue began after a recent change, such as a software installation or Windows update, performing a system restore to a point before the change occurred may resolve the problem.

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.

Troubleshoot end-user issues with NinjaOne’s tools for MSPs.

Learn more about NinjaOne Remote Access

FAQs

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.

You can fix corrupted or missing icons by rebuilding the icon cache. Open Command Prompt as an administrator, run commands to stop Explorer.exe and delete the IconCache.db and related files, then reboot your PC. Windows will automatically regenerate a fresh icon cache on restart.

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.

It is only necessary to rebuild the Windows icon cache when you are experiencing problems.

Thumbnails are managed separately from icons. Rebuilding the icon cache will not affect thumbnails.

Yes. You can create a batch file (.bat) containing all the necessary commands and save it to your desktop. Whenever icon issues arise, simply run the batch file as an administrator. This will handle stopping Explorer, deleting the cache, and restarting the process automatically.

You might also like

Ready to simplify the hardest parts of IT?