• Welcome to Overclockers Forums! Join us to reply in threads, receive reduced ads, and to customize your site experience!

SOLVED The old Rebuild.bat to rebuild icon cache does not work under Windows 8

Overclockers is supported by our readers. When you click a link to make a purchase, we may earn a commission. Learn More.

c627627

c(n*199780) Senior Member
Joined
Feb 18, 2002
Looking for other things to try, it does not reset my custom folder icons. I can test that it does not work by simply renaming the folder, which then switches to correct icon.


taskkill /im explorer.exe /f
CD %USERPROFILE%\AppData\Local
attrib -h iconcache.db
del iconcache.db
explorer.exe


S O L V E D:

The new Rebuild.bat for Windows 8, courtesy of redduc900:

...the *.bat file should be modified as such:

Code:
@echo off
taskkill /IM explorer.exe /f
cd /d %userprofile%\AppData\Local\Microsoft\Windows
del /f /s /q Explorer\IconCache *.*
start explorer.exe
 
Last edited:
I searched and there was only one instance of iconcache.db

Win8 must be storing this info elsewhere because deleting iconcache.db does not reset everything like it does under Windows 7.
 
Try this in your *.bat file...

Code:
@echo off
cls
echo The Explorer process must be killed to delete the Icon DB. 
echo Please SAVE ALL OPEN WORK before continuing
pause
taskkill /IM explorer.exe /F 
echo Attempting to delete Icon DB...
If exist %userprofile%\AppData\Local\IconCache.db goto delID
echo Previous Icon DB not found...trying to build a new one
goto :main
:delID
cd /d %userprofile%\AppData\Local
del IconCache.db /a
pause
echo Icon DB has been successfully deleted
goto main
:main
echo Windows 8 must be restarted to rebuild the Icon DB. 
echo Restart now? (Y/N):
set /p choice=
If %choice% == y goto end
echo Restart aborted...please close this window 
explorer.exe
:end
shutdown /r /t 0
exit
 
Tried a similar bat before, I tried it again, rebooted w/o success.


There is only one instance of iconcache.db on my Windows 8 partition. Even if I reboot into WinXP and delete it from there, the folder icons do not change. They immediately change if I rename the folder, or name the .ico file inside the folder.


Where [else] could Windows 8 be storing this info if not inside iconcache.db? I think that appears to be the question, because with iconcache.db gone, should it not rebuild everything from scratch?


Here are the the details on how to replicate the problem:

• Enable viewing hidden & system files in Tools > Folder Options > View TAB >
CHECK: Show hidden files, folders, and drives
UNCHECK: Hide protected operating system files (Recommended)
to see Dekstop.ini files which change folder icons.


1. Create new folder anywhere, and name it Desktop XP.

2. Place Desktop XP.ico inside it and use Notepad to create Desktop.ini file inside it:

[.ShellClassInfo]
IconFile=Desktop XP.ico
IconIndex=0

IMPORTANT: 3. Use this http://www.petges.lu/download// Attribute Changer to right click on folder and

First set folder as Read-only folder then
set right click on and set Desktop.ini and Desktop XP.ico as both system and hidden files.



So now close folder / refresh / rebuild icons to see changes.
Original quick rebuild.bat without rebooting is OK for this.

FolderInitial.png


However in Windows 8, if you replace Desktop XP.ico with another icon WITH THE SAME NAME, folder icon will not change until you change the folder name or folder icon name.

See when I rename it to Desktop XP2, the icon changes:
FolderChangeName.png



So the question, once again, is where is Windows 8 pulling the folder icon info from if iconcache.db had been deleted and the icon in question is no longer the same even if it has the same name?
 
Do you have a Shell Icons sub-key located under...

Code:
 HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Explorer

It appears as though MS has moved the cache store to...

Code:
C:\Users\Your Name\AppData\Local\Microsoft\Windows\Explorer

... so going by that, the *.bat file should be modified as such:

Code:
@echo off
taskkill /IM explorer.exe /f
cd /d %userprofile%\AppData\Local\Microsoft\Windows
del /f /s /q Explorer\IconCache *.*
start explorer.exe
 
Last edited:
Bingo!


I figured they moved it - that's the new Rebuild.bat for Windows 8 from now on!


Did you figured this out yourself? If not, who else and where was this posted on the world wide web?
 
Back