- Очистка (сброс) поврежденного кэша иконок в Windows 10
- Сброс кэша иконок в Windows с помощью утилиты ie4uinit
- Скрипт удаления файлов с кэшем иконок в Windows
- Purge & rebuild the Icon Cache in Windows 8/7
- Rebuild The Icon Cache
- How to Clear and Rebuild the Icon Cache Completely in Windows
- Clear icon cache completely in Windows
- How to Clear and Rebuild the Icon Cache in Windows
- Method 1: Clear & Rebuild icon cache using ClearIconCache.exe freeware tool
- Method 2: Clear & Rebuild the Icon Cache Database Manually
- Method 3: Automatically Clear & Rebuild the Icon Cache Using Script
- How to rebuild Windows Icon Cache without closing explorer.exe or restarting Windows?
- Attempts
- Question
- Как восстановить Icon Cache в Windows 10
- Где хранится Icon Cache
- Как перестроить Icon Cache
Очистка (сброс) поврежденного кэша иконок в Windows 10
При отображении иконок различных программ или типов файлов в проводнике File Explorer, Windows вместо обращения к исходным файлам с иконками, получает копии картинок значков из специальных файлов с кэшем иконок. За счет того, что операционной системе не нужно каждый раз загружать оригинальные файлы иконок, ускоряется работа и прорисовка объектов в проводнике Windows.
В некоторых случаях, при повреждении файла с кэшем иконок, в проводнике (и на рабочем столе) могут отображаться белые иконки ярлыков и файлов, или вместо иконок приложений отображаются стандартные иконки Windows. В этом случае рекомендуется выполнить сброс системного кэша иконок.
На скриншоте ниже видно, что в макете стартового меню Windows 10 вместо значков некоторых приложений отображаются стандартные иконки папок.
Кэш иконок в различных версиях Windows представляет собой один или несколько db файлов, хранящихся в профиле пользователя.
- В Windows7 это файл IconCache.db в каталоге %userprofile%\AppData\Local
- В Windows10 и Windows8.1 – это множество файлов, имя которых начинается с iconcache_ (iconcache_16.db, iconcache_32.db, iconcache_48.db и т.д. в соответствии с размерами иконки в пикселях) и хранятся в каталоге %userprofile%\AppData\Local\Microsoft\Windows\Explorer
Сброс кэша иконок в Windows с помощью утилиты ie4uinit
В Windows есть специальная встроенная утилита ie4uinit (IE Per-User Initialization Utility), которую можно использовать для быстрого сброса кэша иконок.
- В Windows 10: ie4uinit.exe -show
- Для Windows 7: ie4uinit.exe -ClearIconCache
Эту команду нужно выполнить через меню Win+R -> команда -> Enter.
Команды абсолютно безопасные, но помогают восстановить нормальное состояние кэша иконок далеко не во всех случаях.
Скрипт удаления файлов с кэшем иконок в Windows
Чтобы сбросить кэш иконок, достаточно удалить db файлы с кэшем. Но предварительно нужно завершить процесс проводника File Explorer, чтобы он не блокировал доступ к файлам iconcache. Рассмотрим, как сбросить базу данных кэша иконок без перезагрузки Windows.
- Закройте все запущенные приложения;
- Откройте окно командной строки ( cmd.exe или powershell.exe ) с правами администратора;
- Запустите диспетчер задач taskmgr.exe
- В окне Task Manager перейдите на вкладку Details, найдите процесс explorer.exe и завершите его (End Task);
- Также вы можете завершить процесс из командной строки: taskkill /f /im explorer.exe
- Затем последовательно выполните следующие команды для удаления кэша иконок в профиле пользователя (в зависимости от версии ОС):
Для Windows 10/ 8.1 (просто скопируйте этот код в окно командной строки или сохраните как текстовый файл reset_icon_windows.bat).
Purge & rebuild the Icon Cache in Windows 8/7
If you find that one or more of your icons are not displaying correctly, or that your Icon Cache is corrupted, you might want to rebuild the Icon Cache. The Icon Cache or IconCache.db is a special database file that Windows utilizes to keep copies of each icon handy. When Windows needs to draw an icon, it uses the copy from the cache instead of retrieving the icon image from the original application file. This helps in making Windows draw the icons faster.
Rebuild The Icon Cache
In Windows 8, Windows 7 and Windows Vista, this IconCache.db file is located at:
Whereas, it is different in the older version of Windows i.e. Windows XP.
If you find your Windows displaying icons on the desktop in the wrong manner you can purge & rebuild the Icon Cache In Windows.
If you need to rebuild the Icon cache, Open File Explorer > Folder Options > Views to show Hidden System Files. Next, go to C:\Users\Username\AppData\Local folder and delete the hidden IconCache.db file. Reboot. This action will purge and rebuild the icon cache.
There is also another way to do it, should the above method not work for you.
Kill Explorer.exe process. In Windows 7, click Start button > Hold down Ctrl+Shift & Right Click on an empty area in the Start Menu > Click “Exit Explorer”. In Windows 8, you may do so via the Task Manager.
Open the command prompt window, type each of the following and after every command, hit the Enter button:
Your Windows Icon Cache would have been rebuilt.
You may also want to check out our freeware Icon Cache Rebuilder Tool to automate the entire process of repairing icon cache.
How to Clear and Rebuild the Icon Cache Completely in Windows
Icon cache corruption may happen sometimes, causing wrong icons to show up for certain programs or in certain areas of the Windows shell, or no icons at all. My earlier post Incorrect icon shown for a file type tells you how to refresh the shell icons using Default Programs.
In case the solution posted in that link does not help, you may want to completely clear and rebuild the icon cache database. This post explains how to completely clear the icon cache (and let Windows rebuild it), using a specialized tool, or with a script I wrote, or manually — for all versions of Windows, including Windows 10.
Clear icon cache completely in Windows
How to Clear and Rebuild the Icon Cache in Windows
To render the icons for various shell objects like folders, special folders, and files, Windows caches the icons in database files so that Windows doesn’t have to read the file or folder icon and extract them every time. Occasionally, you’ll see icon-caching bugs in Windows resulting in incorrect, missing or out-of-date icons being shown for programs and desktop shortcuts, and other areas of the shell.
If refreshing the icons using ie4uinit.exe or Default apps doesn’t help, you’ll have to completely clear the icon cache.
Let’s see how to clear the icon cache completely, and let Windows rebuild it as and when it requires.
Method 1: Clear & Rebuild icon cache using ClearIconCache.exe freeware tool
Clear Icon Cache (ClearIconCache.exe) utility from Leo Davidson will cleanly exit Explorer, delete the shell icon cache (IconCache*.db) and localized thumbnail cache (ThumbCache*.db) and then restart Explorer.
Leo Davidson is a trusted source — he is the one wrote the famous PDF x64 thumbnail & preview fix for Windows few years back. And, he’s the owner of FileTypeDiag and many other useful portable tools.
With Clear Icon Cache, you just double-click the program and it takes care of the details for you. Clear Icon Cache works in Windows Vista, Windows 7, Windows 8 and Windows 10.
To run the utility in noninteractive or silent mode, run ClearIconCache.exe /QUIET
As said earlier, the utility also clears the thumbnail caches on the computer.
Method 2: Clear & Rebuild the Icon Cache Database Manually
The icon cache database files are located in your LocalAppData folder with file names prefixed with iconcache_ – each icon size has a separate cache (database) file.
The file names look like this:
- Close all folder windows that are currently open.
- Launch Task Manager using the Ctrl + Shift + Esc key sequence.
- In the Task Manager Process tab, right-click on the Explorer.exe process and select End Process.
If you receive Access is Denied error when deleting the IconCache*.db files, then one or more of the open programs is using the icon cache database. Close all programs and try again, or try clearing them from Safe mode.
In Task Manager, click File, select New Task (Run…)
Editor’s note: Instead of using Task Manager to exit Explorer.exe in Step 3 above, even better way to do this is to terminate the Explorer.exe Shell cleanly using the method described in article Terminate and Restart Explorer.exe Process Cleanly in Windows 7 & Windows Vista. If you’re using Windows 8 or Windows 10, check the article How to Exit Explorer and Restart Explorer in Windows 10.
Method 3: Automatically Clear & Rebuild the Icon Cache Using Script
This first method uses a small script that I wrote to clean up the icon cache completely. Once done, the script restarts Explorer shell for the change to take effect.
To clear the icon caches for Windows Vista, 7, 8 and Windows 10, download the zip file below, unzip and run the script file cleariconcache.vbs.
- Download cleariconcache.zip and extract the contents to a folder.
- Save all your work, and close all programs so that icon cache files are not locked by any program.
- Double-click the script file cleariconcache.vbs
- Click Yes when you’re prompted to restart the shell.
If the Icon Cache database files can’t be deleted, some programs are using it. Close all applications and try running the script again.
Once you close all programs, the program should be able to delete the icon cache files.
After clearing the cache, Explorer shell should start automatically, and rebuilds a fresh set of icon cache.
Hope you were able to fix icon rendering issues on your Windows computer by clearing the icon cache completely.
How to rebuild Windows Icon Cache without closing explorer.exe or restarting Windows?
I am trying to customise a folder icon from within my Application but due to the way Windows caches icons and thumbnails I am struggling to get the changed folder to update it’s new icon.
In Windows there are two ways that I know of to customise a folders icon, the simplest way is to right click the folder from Windows Explorer, Properties and then select the Customize tab and change its icon, this method is no good though as it requires manually changing the folder properties.
The second way which I am doing from my program is to create a desktop.ini file and place it inside the folder that requires the icon changing, documentation on desktop.ini can be found here: http://hwiegman.home.xs4all.nl/desktopini.html and an article here: http://helpdeskgeek.com/how-to/customize-folder-icons-desktop-ini/
As shown below though, the folder icon in Windows is not updated although you can see from the folder properties that the icon has changed, just Windows is not showing the updated folder icon:
I am fully aware of Windows caching icons and thumbnails, I have searched and read several pages on ways to supposedly rebuild the icon cache and thus get Windows to display the newly changed icon and not the cached one, however I am unable to get this to work from my Application without restarting Windows or the Explorer.exe process, this needs to be done without interrupting Windows though so closing Explorer.exe or requiring a restart is absolutely not an option.
Interestingly though, when changing a folder icon from the first way I described earlier, Windows somehow manages to flush and rebuild the icon cache as the changed folder is promptly updated to show the new icon, however I cannot see what tricks Windows does to achieve this.
Attempts
A few things I tried unsucessfully, (in no particular order):
- Executing the following: ie4uinit.exe -ClearIconCache
- Running this code in Lazarus: SHChangeNotify(SHCNE_ASSOCCHANGED, SHCNF_IDLIST, nil, nil);
- Deleting the IconCache.db file from AppData\Local
- Toggling the «Always show icons, never thumbnails» Explorer option from the registry, located here: HKEY_CURRENT_USER\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer\Advanced which is stored in the IconsOnly value
- Changing the icon size from the registry and back, located here: HKEY_CURRENT_USER\Control Panel\Desktop\WindowMetrics which is stored in the Shell Icon Size value
- This link provides an apparent solution in Delphi which I was unable to convert in Lazarus: http://www.aha-soft.com/faq/q18.htm
- I am aware of cached db files here: AppData\Local\Microsoft\Windows\Explorer although I am not sure if they are of any help, attempting to delete some of them does not seem possible as they may be locked etc.
- Renaming the folder and then rename back to original name.
- Right click an empty space in Windows Explorer and selecting Refresh does not seem to update the folder icon either.
Have also tried performing some of the above in combination with no luck.
Question
When changing a folder icon directly from Windows Explorer, using the properties context menu and customize tab, when applying and closing this dialog the folder icon is changed almost immediately, there is no closing explorer.exe or restarting Windows, the change happens very much right away.
How can I achieve this from my Application programmatically the same way Windows Explorer does? Is there a way to find out how Windows Explorer does this?
My Operating System is Windows 10 which could explain why some of the older methods don’t work for me.
Как восстановить Icon Cache в Windows 10
Значки и иконки, которые использует Windows для ваших документов и программ, сохраняются в кэш иконок. Поэтому они отображаются быстро, вместо того, чтобы медленно загружать их каждый раз. Если с их отображением возникают проблемы, то есть способы восстановить работоспособность. Иногда кэш значков устаревает, в результате чего значки могут отображаться неправильно или даже теряться. Бывают разные ситуации и сброс icon cache, и автоматическое воссоздание путей решает эту проблему. Покажу, как это сделать в Windows 10, но так же этот способ подходит и для Windows 8 и 7.
Где хранится Icon Cache
Чтобы увидеть директорию AppData, нажмите Win+R и введите %appdata% или включите отображение скрытых элементов и проследуйте по пути. В Windows Vista и Windows 7 кэш-файл значок находится в
C: \ Users \ \ AppData \ Local \ IconCache.db
Этот файл по-прежнему присутствует в Windows 8 и 10, но Windows не использует их для хранения кэша иконок. В операционной системе Windows 8 и Windows 10 кэш-файл значок находится в:
C: \ Users \ \ AppData \ Local \ Microsoft \ Windows \ Explorer
В этой папке вы найдете несколько файлов кэша иконок:
Чтобы перестроить кэш иконок, вы должны удалить все файлы iconcache, которые появляются в этой папке. Просто так удалить их не удастся, потому как проводник все еще использует их.
Как перестроить Icon Cache
Закройте и сохраните программы, которые работают, сохраните открытые документы, прежде чем продолжить. Откройте Проводник и перейдите в следующую папку:
Нажмите и удерживайте нажатой клавишу «Shift«, и щелкните правой кнопкой мыши на папке Explorer. Выберите «Открыть окно команд»
C: \ Users \ \ AppData \ Local \ Microsoft \ Windows \ Explorer
Чтобы убедиться, что командная строка находится в нужной папке. Введите dev команду, вы должны увидеть iconcache и thumbcache файлы.
Теперь нужно завершить процесс Explorer в диспетчере задач, или нажмите Ctrl+Alt+Del. Кликните правой кнопкой по проводнику и завершите процесс.
Не пугайтесь! Исчезнет проводник и рабочий стол, экран станет черным, снимите задачу диспетчера устройств. Переключитесь на командную строку и введите команду:
Если по какой-то причине отказано в доступе, завершите процессы. Убедитесь, что диспетчер задач не запущен и повторите процедуру. Помните, вы всегда можете использовать Ctrl+Alt+Del и диспетчер задач. Простой командой explorer можете вновь запустить проводник, чтобы вернуть привычный рабочий стол и графический интерфейс.
Если все прошло гладко, жмите Ctrl+Alt+Del и выключите, или перезагрузите компьютер. После этого кэш должен пересоздать и значки, и иконки, всё будет отображаться корректно.
Если возникнут вопросы, отвечу в комментариях, жмите поделиться, если статья понравилась, удачи!
У меня есть статья про чудесную утилиту AVZ. С помощью мастера устранения проблем можно очистить кеш в автоматическом режиме. Будьте внимательны и все получится.