Software-OK
≡... News | ... Home | ... FAQ | Impressum | Contact | Listed at | Thank you |

  
HOME ► Faq ► FAQ - Batch-Scripts ► ««« »»»

Batch script to clear icon/thumbnail cache!?


To clear the icon cache and thumbnail cache in Windows 10, 11 and 12, you can use the following batch script:









1. Clear icon and thumbnail cache in Windows?
2. Explanation of the script:
3. Are there differences between Windows 12 and MS Server?







1.) Clear icon and thumbnail cache in Windows?



@echo off
echo Exit Windows Explorer ...
taskkill /f /im explorer.exe

echo Wait 1 second ...
timeout /t 1 /nobreak >nul

echo Clear icon cache ...
del /A /Q "%localappdata%\IconCache.db"
del /A /Q "%localappdata%\Microsoft\Windows\Explorer\thumbcache_*.db"
del /A /Q "%localappdata%\Microsoft\Windows\Explorer\iconcache_*.db"
echo Restart Windows Explorer ...
start explorer.exe

echo Icon and thumbnail cache have been cleared!
pause




2.) Explanation of the script:



1. Save the script as `cache_loeschen.bat`.

2. Right-click → "Run as administrator".

3. Windows Explorer will restart and the cache will be deleted.

4. If the changes are not immediately visible, log out and log in again or restart the PC.

📌 Note: A short wait after closing Explorer ensures that the cache can be safely deleted.




3.) Are there differences between Windows 12 and MS Server?



Yes, there are minor differences between Windows 12 and MS Server when clearing icon and thumbnail cache:

Windows 12 vs. MS Server (2022, 2019, 2016)



1. Icon cache location

- Windows 12: `%localappdata%\IconCache.db`

- MS Server: The icon cache file often does not exist in newer server versions because Windows Server does not store icons for many applications by default.

2. Thumbnail cache

- Windows 12: `%localappdata%\Microsoft\Windows\Explorer\thumbcache_*.db`

- MS Server: The thumbnail cache is disabled by default to save resources. If enabled, it is located in the same location as Windows 12.

3. Restart Explorer


- Windows 12: `taskkill /f /im explorer.exe` → `start explorer.exe`

- MS Server: On Core editions (without GUI) there is no Explorer, so the cache must be cleared by other methods, e.g. `del` commands in PowerShell or Group Policy.

Recommended customization for Windows Server:


If thumbnails are enabled, you can easily customize the batch script:

@echo off
echo Exit Windows Explorer ...
taskkill /f /im explorer.exe

echo Wait 1 second ...
timeout /t 1 /nobreak >nul

echo Clear the thumbnail cache (if it exists) ...
del /A /Q "%localappdata%\Microsoft\Windows\Explorer\thumbcache_*.db"
del /A /Q "%localappdata%\Microsoft\Windows\Explorer\iconcache_*.db"

echo Restart Windows Explorer (if it exists) ...
if exist C:\Windows\explorer.exe start explorer.exe

echo Cache has been cleared!
pause

📌 Note for Windows Server:

- If the thumbnail cache does not exist, it is probably deactivated in the group policies:
👉 "Do not show thumbnails or only icon" under
`gpedit.msc` → User Configuration → Administrative Templates → Windows Components → File Explorer

⚡ Summary:

- Windows 12: Standard script works directly.

- MS Server: Explorer not always available, thumbnails usually deactivated. Script may need to be adjusted.



FAQ 3: Updated on: 27 February 2025 08:39 Windows
Batch-Scripts

Windows batch file to establish a simple FTP connection?


To create a simple FTP connection using a Windows 12, 11, or 10 batch file and run some basic FTP commands, you can create a batch file Which executes the
Batch-Scripts

Delete temporary files with batch script!?


The script is useful, but there are some differences between Windows 10, 11, 12 and MS Server when deleting temporary files and the Recycle Bin: IN ADVANCE:
Batch-Scripts

What are Windows Batch Scripts!


Windows batch scripts, correctly called batch files, are simple text files that contain a series of commands that can be executed in the command line environment
Batch-Scripts

Windows batch file to establish a simple FTP connection?


To create a simple FTP connection using a Windows 12, 11, or 10 batch file and run some basic FTP commands, you can create a batch file Which executes the
Batch-Scripts

Batch script to clear icon/thumbnail cache!?


To clear the icon cache and thumbnail cache in Windows 10, 11 and 12, you can use the following batch script: 1. Clear icon and thumbnail cache in Windows?
Batch-Scripts

Delete temporary files with batch script!?


The script is useful, but there are some differences between Windows 10, 11, 12 and MS Server when deleting temporary files and the Recycle Bin: IN ADVANCE:

»»

  My question is not there in the FAQ
Asked questions on this answer:
Keywords: batch, scripts, script, clear, icon, thumbnail, cache, windows, following, Questions, Answers, Software




  

  + Freeware
  + Order on the PC
  + File management
  + Automation
  + Office Tools
  + PC testing tools
  + Decoration and fun
  + Desktop-Clocks
  + Security

  + SoftwareOK Pages
  + Micro Staff
  + Freeware-1
  + Freeware-2
  + Freeware-3
  + FAQ
  + Downloads

  + Top
  + Desktop-OK
  + The Quad Explorer
  + Don't Sleep
  + Win-Scan-2-PDF
  + Quick-Text-Past
  + Print Folder Tree
  + Find Same Images
  + Experience-Index-OK
  + Font-View-OK


  + Freeware
  + IsMyLcdOK
  + DesktopDigitalClock
  + ClassicDesktopClock
  + PreventTurnOff
  + QuickMemoryTestOK
  + IsMyHdOK
  + AutoPowerOptionsOK
  + OneLoupe
  + TraceRouteOK
  + PAD-s


Home | Thanks | Contact | Link me | FAQ | Settings | Windows 10 | gc24b | English-AV | Impressum | Translate | PayPal | PAD-s

 © 2025 by Nenad Hrg softwareok.de • softwareok.com • softwareok.com • softwareok.eu


► Random brightness option for dropping snow, leaves, flowers on desktop? ◄
► How long do SSDs really last? ◄
► What will Windows 12 offer me? ◄
► Can I easily remove the desktop clock from my Windows! ◄


This website does not store personal data. However, third-party providers are used to display ads,
which are managed by Google and comply with the IAB Transparency and Consent Framework (IAB-TCF).
The CMP ID is 300 and can be individually customized at the bottom of the page.
more Infos & Privacy Policy

....