1

I'm trying to change iconresource on desktop.ini file after changing folder icon with this python script but I got this:

Exception has occurred: PermissionError [Errno 13] Permission denied: 'desktop.ini'

I've tried run as administrator, disabling UAC, and changing security permissions of file but no answer.

import configparser
config = configparser.ConfigParser()
config.read('desktop.ini')
pieces = config['.ShellClassInfo']['iconresource'].split('\\')
del pieces[:-1]
config['.ShellClassInfo']['iconresource'] = pieces[0]
with open('desktop.ini','w') as configfile:
    config.write(configfile)

Exception has occurred: PermissionError [Errno 13] Permission denied: 'desktop.ini'

hem
  • 994
  • 5
  • 11
Araeek
  • 11
  • 1
  • Did you try [this answer](https://stackoverflow.com/questions/36434764/permissionerror-errno-13-permission-denied/36469464) ? – IMCoins Aug 05 '19 at 08:41
  • Did you manage to get this working? I have the exact same issue. I first thought that it was because I was running in a venv, but outside that the issue still persists. – Matthieu Mar 27 '20 at 20:42

0 Answers0