I'm using this batch script to change the icons of all the folders and sub-folders to the .ico files that are located in the folders.
However the folder icons do not change in Explorer unless I manually rename desktop.ini
file in Explorer to something else and then back to desktop.ini
or change the letters to uppercase for example.
I even wrote a batch function to automatically rename the desktop.ini but it doesn't work.
What is the difference between renaming them manually and renaming it from a batch file and how can I make Explorer use the new desktop.ini
?
@echo off
for /r %%I in (*.ico) do (
attrib -r -s "%%~dpI." /S /D
if exist %%~dpIdesktop.ini (
del "%%~dpIdesktop.ini"
)
>>%%~dpIdesktop.ini echo [.ShellClassInfo]
>>%%~dpIdesktop.ini echo IconResource="%%~nI%%~xI",0
attrib -h desktop.ini /S
attrib +r -s "%%~dpI." /S /D
)