Ian Boyd
Ian Boyd

Reputation: 256581

How to determine why application is prompting for elevation

When launching my executable, Windows is prompting for elevation, when it shouldn't be.

How can i figure out why Windows is prompting me to elevate my executable on launch?

Notes:

How can i determine why my application is prompting for elevation?

Upvotes: 4

Views: 1477

Answers (1)

Kate Gregory
Kate Gregory

Reputation: 18944

In the absence of a manifest, the usual reasons are name heuristics (eg your file is called setup.exe) and group policy (which you may have set accidentally after a "this program may not have run as expected" dialog.)

To prevent it, simply apply a manifest (embedded or external) with asInvoker. Then you will no longer care about these heuristic and you will not elevate.

I know I commented this above but I need to repeat it: What your code tries to do will NEVER cause elevation. NEVER. Stuff that won't work unless you're elevated fails when you're not elevated. It doesn't elevate you.

Upvotes: 4

Related Questions