@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.
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
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:
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
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
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?
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:
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 ....