@echo off
setlocal
echo ============================================
echo Windows Icon Cache Refresh
echo ============================================
echo.
echo This will restart Windows Explorer briefly.
echo Your desktop and taskbar will blink once - this is normal.
echo.
pause
rem LOCALAPPDATA exists since Vista; fall back to XP path
set "LAD=%LOCALAPPDATA%"
if "%LAD%"=="" set "LAD=%USERPROFILE%\Local Settings\Application Data"
echo [1/3] Stopping Windows Explorer...
taskkill /F /IM explorer.exe >nul 2>&1
rem ping is used as a delay because it exists on every Windows version
ping -n 2 127.0.0.1 >nul 2>&1
echo [2/3] Deleting icon cache files...
del /F /Q "%LAD%\IconCache.db" >nul 2>&1
del /F /Q "%LAD%\Microsoft\Windows\Explorer\iconcache_*.db" >nul 2>&1
del /F /Q "%LAD%\Microsoft\Windows\Explorer\thumbcache_*.db" >nul 2>&1
echo [3/3] Restarting Windows Explorer...
start "" explorer.exe
echo.
echo Done. Wait a few seconds for the desktop to settle,
echo then check the IcbcGoldDesktop.exe icon again.
echo If it is still old, log off and log back in once.
echo.
pause批处理一键清除Windows操作系统应用图标缓存
在Windows窗体应用程序开发时经常碰到一个问题,更换应用程序图标后重新编译生成应用程序,结果exe文件图标仍是旧的,复制到其他文件夹图标就正常,这是因为Windows系统缓存了图标,让WorkBuddy写了一个批处理一键清除图标缓存(refresh_icon_cache.bat):
评论(0)
暂无评论。