0

I had created two files to change the icon of some folders. More specifically, I added one .ico file and then a folder.ini with the following content:

[ViewState]
Mode=
Vid=
FolderType=Pictures
[.ShellClassInfo]
IconFile=Icon.ico
IconIndex=0

The trick did not work and in order to see the folder icons I created a .bat file:

set startdir=%cd%
ATTRIB +s %startdir%
ATTRIB +s "%startdir%\*.*" /S /D

When I right click at the settings of the folder I can see that the "Read-only (only applies to files in folder)" is ticked and even if I untick it and save, it remains the same. Also, if I open an image with the default photo viewer from Windows, I am not able to scroll using the arrows (when there are more than 1 images in the same folder). This is working before I applied the batch.

So, my step was to change the bat file to this:

set startdir=%cd%
attrib -s "%cd%" /s

but it did not work. What am I missing?

2 Answers 2

0

you can set the folder icon with 1 click if you put this .batch file in "C:\Users\User\SendTo"

(
echo [.ShellClassInfo]
echo IconResource=folder.ico,0
) > %1\desktop.ini
attrib -A %1\desktop.ini
attrib +S +H %1\desktop.ini
attrib +R %1
0

The read-only attribute cannot be set to folders.

Okay, not entirely true, yes, you can use attrib to set the read-only attribute to a folder, and then using attrib /d you can view that the folder has read-only attribute, but windows will fully ignore it and explorer will not show you the folder has the read-only attribute either.

That said, for the desktop.ini file to work, the folder must have both system and read-only attribute set, and although removing the archive attribute is not mandatory, Microsoft creates them without the archive attribute set.

As soon as the folder does not have the read-only or system attribute set, the desktop.ini file stops working, and thus the icon will not work and neither other hacks you've used for this folder.

Next, the desktop.ini file also needs to have these attributes set.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .