I wrote a batch script to peruse all png files in a folder and assign them as folder pictures when there's are folders with the same name.
The script works flawlessly when it comes to write the information to desktop.ini
files. There's only a small issue: It doesn't work. I can't get the folders to read the modified desktop.ini
files and update their pictures.
I'm using Windows 8.1. I suspect I need to delete some sort of cache, but I don't know which and how exactly. From what I've read, when changing folder icons you need to kill explorer.exe, delete iconcache files and restart explorer.exe.
I have no idea whether the iconcache files also store folders pictures, but killing explorer is awful for my workflow anyway. I'd like a process that doesn't require killing tasks if possible.
Below is the script I'm using:
set DriveL=E
set F=desktop.ini
set CatRoot=Media\Textures ^& 3D
set Cat=Nature Shaders
cd "%DriveL%:\%CatRoot%"
for /R %%I ("%Cat%\*.png") do @(
if exist %%~dpI%%~nI\ (
attrib -h -s -r "%~dp0%%~nI\%F%" 2>nul (
echo [ViewState]
echo Mode=
echo Vid=
echo FolderType=Pictures
echo Logo=%%~dpI%%~nxI
) > "%~dp0%%~nI\%F%"
attrib +s +h +r "%~dp0%%~nI\%F%"
)
)
pause