How do I edit read only .ini file on the system root from the code on windows vista ?

I have a windows application compiled on c#.It works on Windows XP but if I install it on Windows Vista it gives me error. The Application has one ".ini" file which saves some configuration settings into it. And this file is created at the application folder after running the application.Application foldre is on system root\Program files. When I run the application on windows vista and I create that ".ini" file,Windows Vista put  it as Read Only. Because of this ,if I can't edit that file from the application runtime , it gives me message as "access to the file denied". It happens only on Windows vista.
Who is Participating?
Vista UAC blocks you from accessing files in "program files" folder.

You can do one of these 3 things:
1) acquire/elevate user permissions within your software,
2) store your settings in application-friendly CSIDL_APPDATA folder,
3) turn off UAC from the control panel (not a good idea).
RETAILREALMAuthor Commented:
thanks a lot.
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.