As pointed out in Writing config file in C:Program Files (x86)MyAppmyapp.cfg, vs. Administrator privilege, it is not a good idea to write a config file in C:Program Files (x86)MyAppmyapp.cfg.
C:Program Files (x86)MyAppmyapp.cfg
Instead of this, my software now saves its data in a subdir of %ALLUSERSPROFILE% (ex : C:ProgramDataMyAppmyapp.cfg on Win7)
%ALLUSERSPROFILE%
C:ProgramDataMyAppmyapp.cfg
[I use myfile = open(filename, 'a') in Python to do this.]
myfile = open(filename, 'a')
I now encounter an issue about this file :
User A
User B
User 2
Permission denied
Why? Isn't %ALLUSERSPROFILE% a place that can be written by all users? How to solve this problem ?
2.1m questions
2.1m answers
60 comments
57.0k users