2

so i want to change desktop.ini to use custom folder icons

with open("desktop.ini", "a") as f:         
    f.write("[.ShellClassInfo]"+"\n")
    f.write("IconResource="+logo+",0")
 
os.system("attrib +h +s desktop.ini")

the desktop.ini file gets edited, its both hidden and a system file, and the text is identical to the text if i changed the icons manually, but it still doesn't work. any ideas?

martineau
  • 119,623
  • 25
  • 170
  • 301
humantrash
  • 63
  • 6
  • There is probably some Windows API you have to use to change or create this file — google is your friend. – martineau Sep 02 '21 at 16:35
  • Maybe Windows will recognize this if you reboot the machine. – Matthias Sep 02 '21 at 16:47
  • According to https://superuser.com/questions/410085/is-there-a-way-to-easily-set-the-icon-a-folder-uses/410091#410091 you might have to set the read-only attribute on the folder. – Matthias Sep 02 '21 at 16:51
  • yes just solved it, i have to attribute system file to the containing folder also. ty for the help :) – humantrash Sep 02 '21 at 17:14

0 Answers0