I have an old application which creates and updates 2 files directly in "C:\Documents And Settings\All Users". This software used to work like a charm under Windows 2000 and Windows XP. However, since we have moved to Windows 7, we have had problems with updating those 2 files.
After a quick investigation, I discovered that the file permissions on the files were too restrictive for our application to work correctly. So I have tried changing the file permissions to grant full control to the user Everyone. This worked fine the first time we update the files, but after the first write, Windows 7 restored the file permissions to some default values. I also tried to take ownership of the "C:\ProgramData" folder, and grant full control again to Everyone, but again, after the first write operation, the file permissions are restored to the default settings.
The User Account Control setting is currently set to "Notify me when programs try to make changes to my computer (do not dim my desktop)". If I turn it off, the problem disappears. However, this is not a viable solution for customers using our software.
It is not possible for me to change the location of those two files. How can I grant full control over specific file located in "C:\ProgramData" while preventing the Operating System from restoring some default permissions?