Shady Nawara
Shady Nawara

Reputation: 502

Request UAC Elevation c#

Hi when i try to open my app in win-xp it works fine but when i try it on win7 it says access to path (path location) is denied unless i open it as administrator so how can i give my app administrator rights without promoting

Thank you

Upvotes: 3

Views: 2221

Answers (1)

David Heffernan
David Heffernan

Reputation: 613511

You can't gain administrator rights on a system with UAC without passing through UAC elevation.

Your options are:

  1. Manifest your app so that it always runs as administrator. The user sees the UAC dialog every time they start the app.
  2. Separate the part of the app that needs admin rights into a separate process and just require elevation for that part.
  3. Re-work your app so that it doesn't need admin rights.

Of these options you should prefer 3. If you can't achieve that then 2 is better than 1.

Upvotes: 8

Related Questions