1

My app is developed on Win 7. I login as a standard user and run my app under administrator(rights-click and select 'Run as Administrator'), the program can write files in 'Program File'. But if I run the app by double-click, the app run fail.

I don't want to set UACs on manifest file because it always shows UACs prompt.

how can I set writable privilege or admin rights for my app?

Please help me,

thanks,

jthill
  • 55,082
  • 5
  • 77
  • 137
Anglejoy
  • 63
  • 1
  • 8

1 Answers1

0

Only app under administrator can write in 'Program Files'. You should use %AppData% for common tasks.

Kirill
  • 46
  • 1
  • Hi Kirill! thanks so much. Can I adjust privilege for current process to write files in 'Program Files'? – Anglejoy Jun 06 '12 at 10:15
  • There is similar question: http://stackoverflow.com/q/6281696/780488.I can add that when I had this problem I run separate process from my app. This separate procces requests admin rights from users. – Kirill Jun 06 '12 at 10:29
  • @Anglejoy - If you could, what would be the use for UAC? – Bo Persson Jun 06 '12 at 10:29