Mass Change Folder Icon

don6558

New member
Local time
11:32 PM
Messages
5
This is not a default icon inquirey.

Thank you to Neutron16 for his/her tutorial on mass icon change using a predefined folder with custom icon as source. Closest thing to what I want yet, but not quite there yet.

I want to be able to write a bat, script, exe (visual basic) to change the icons by icon name. i.e. File named x.avi, code looks in icon directory for icon named x.ico, file named y.avi, code looks in icon directory for icon named y.ico, etc.

What I've found so far is that once a folder has had a custom icon, I can change the desktop.ini and the folder icon will change as well. If I restore the folder icon (custom properties dialog) or if the folder has never had a custom icon, changing the desktop.ini file never changes the folder icon, even after closing and reopening the windows explorer.

This implies there is another folder property which must be set.

I'm not strong in bat file command but I understand that xcopy copies everything including all properties. This is why Neutron16's bat works and my code does not.

Question is, what is the name of that property/properties and how do I access it or am I going down the wrong path here?
 
Last edited:

My Computer

OS
Windows 7 Home Premium x64
Gotta love forums.

As I was forming the question above it caused me to rethink what I had already tried and what I already knew. "The folder must be set to ReadOnly for Windows to read the Desktop.ini file". (This is indeed the answer.)

This cause me to ask the question How do I make only the folder ReadOnly. Changing the the property to ReadOnly in the properties dialog only makes the contents of the folder ReadOnly. I did a search and found the answer, tried it and I can now change the icon by copying or creating the desktop.ini file by code or by hand.

Here is some code to give you a Context Menu to make the folder ReadOnly.
Code:
[INDENT]Windows Registry Editor Version 5.00
[HKEY_CLASSES_ROOT\Folder\shell\SetReadOnly]
@="Set folder read-only"
 
[HKEY_CLASSES_ROOT\Folder\shell\SetReadOnly\Command]
@="cmd /c attrib +r \"%1\""
[/INDENT]

Save as .reg file and merge with Windows Registry.

Happy Icons.
 

My Computer

OS
Windows 7 Home Premium x64
Back
Top