Windows Batch File – Change File and Folder Attributes Without Slowing Down Hard Disk

batchbatch filewindows

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?

Best Answer

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
Related Question