How to Rebuild the Thumbnail Cache From PowerShell on Windows 11
🔍 WiseChecker

How to Rebuild the Thumbnail Cache From PowerShell on Windows 11

Quick fix: Open PowerShell as Admin. Stop Explorer: Stop-Process -Name explorer -Force. Delete thumbnail cache: Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\thumbcache_*.db" -Force. Restart Explorer: Start-Process explorer. Thumbnails regenerate as folders are browsed. Fixes broken / wrong thumbnails.

Thumbnail cache holds previews for images, videos, documents. When cache corrupts: thumbnails show wrong file, are blank, or show old versions. Rebuilding forces fresh generation from actual files.

Symptom: Want to rebuild Windows 11 thumbnail cache via PowerShell.
Affects: Windows 11.
Fix time: ~5 minutes.

ADVERTISEMENT

What causes this need

Thumbnail cache files (thumbcache_*.db in %LOCALAPPDATA%\Microsoft\Windows\Explorer\) speed up File Explorer thumbnails. Reasons to rebuild:

  • Thumbnails show wrong image (cache out of sync).
  • Black / blank thumbnails for valid files.
  • Corrupted DB after disk error.
  • Privacy: clear viewed file history.
  • Cache too large; need to reset.

Method 1: PowerShell script for full rebuild

The standard route.

  1. Open PowerShell as Admin.
  2. Run this script:
    # Stop Explorer
    Stop-Process -Name explorer -Force
    
    # Delete thumbnail cache
    Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\thumbcache_*.db" -Force -ErrorAction SilentlyContinue
    Remove-Item -Path "$env:LOCALAPPDATA\Microsoft\Windows\Explorer\iconcache_*.db" -Force -ErrorAction SilentlyContinue
    
    # Restart Explorer
    Start-Process explorer
    
    Write-Host "Thumbnail cache rebuilt"
  3. Wait. Explorer restarts.
  4. Browse to a folder with images. New thumbnails generate (takes time for large folders).
  5. For specific user cache: cache is per-user. Run script as the user, not Admin (without elevation).
  6. For multi-user PC: each user clears their own cache.
  7. For automated: schedule via Task Scheduler.

This is the standard usage.

ADVERTISEMENT

Method 2: Use Disk Cleanup for GUI

For non-PowerShell users.

  1. Open Disk Cleanup: Win+R → cleanmgr.exe.
  2. Pick C: drive. OK.
  3. Tick Thumbnails.
  4. Click OK. Confirms deletion.
  5. Wait. Cache cleared.
  6. Restart File Explorer (Task Manager → right-click Explorer → Restart).
  7. Browse folder. Thumbnails regenerate.
  8. For batch cleanup: cleanmgr /sageset:1 + /sagerun:1 with Thumbnails option.
  9. For Settings approach: Settings → System → Storage → Temporary files. May include thumbnail cache.

This is the GUI route.

Method 3: Per-folder thumbnail refresh

For specific folder.

  1. If problem is in one folder only:
  2. Open File Explorer to that folder.
  3. View menu → pick Refresh (F5).
  4. For deeper refresh: change view to Details, then back to Large icons. Forces re-render.
  5. For specific file: right-click file → Properties → Details. View metadata, refresh thumbnail.
  6. For local thumbnail cache cleanup per-folder: not directly supported. Use Method 1 for full rebuild.
  7. For chronic thumbnail issues in specific folder: check folder permissions. User must have Read.
  8. For File Explorer caching wrong file: combined explorer + thumbnail issue. Restart Explorer.
  9. For network folders: thumbnails cached locally. Same procedure.

This is the per-folder.

How to verify the fix worked

  • Folders show new fresh thumbnails after refresh.
  • %LOCALAPPDATA%\Microsoft\Windows\Explorer\ shows recently-modified thumbcache_*.db (newly generated).
  • No more broken / wrong thumbnails.
  • Disk space initially smaller (no cache), grows as thumbnails regenerate.

If none of these work

If thumbnails still broken: Disable thumbnails entirely: Folder Options → View tab → tick Always show icons, never thumbnails. Saves space, slower image preview. For specific file types: codec or shell extension missing. Install codec pack for video. For PDF: install Adobe or Foxit. For corrupted files: thumbnail generation may crash Explorer. Check Event Viewer → Application logs. For OneDrive / cloud-only files: thumbnail generated on first download. Trigger by hovering or right-clicking file. For chronic Explorer crashes: sfc /scannow + dism /online /cleanup-image /restorehealth. For HEIC / WebP images: install HEIF Image Extensions from Microsoft Store. For very large folders (10000+ files): Explorer may struggle. Use Windows search instead. For chronic broken: Reset This PC → Keep my files.

Bottom line: PowerShell as Admin: stop Explorer → delete thumbcache_*.db in %LOCALAPPDATA%\Microsoft\Windows\Explorer\ → restart Explorer. Or use Disk Cleanup → tick Thumbnails. Folder views regenerate fresh thumbnails.

ADVERTISEMENT