Hello Norbert,
as you already wrote, it is not possible to change the read/write permissions of protected directories with user rights.
You can, however, use new built-in UAC mechanisms to temporarily assume administrator privileges to make the necessary changes.
The mechanism is described in a
Microsoft TechNet article.
The user has to enter his password for this and needs to have the rights to get administrator privileges. If you only want to write this file once, I guess this this is acceptable.
As for your second questions - there really is no "good way" to write to protected folders in Vista.
The Vista security model has been changed to be closer to that of most other operating systems, which means that there are some directories which applications simply are not supposed to write to. Of course, this does not make things easier if you want to write a program that runs in Vista and previous versions of Windows. I suppose a good place to write your ini files to is the <UserProfile>\AppData\YourApp directory, which should always be readable and writeable by the user in Windows Vista, and is also available in XP and 2000.
Here are two more links about UAC:
http://zone.ni.com/devzone/cda/tut/p/id/5538http://www.regdeveloper.co.uk/2006/09/22/vista_for_developers/Regards,
Johannes
National Instruments Germany