I am developing a C# application that needs to detect whether the user is running as elevated administrator. I tried the solution suggested by Steven.
I checked the solution on 5 machines and it works fine on 4 of them.
There is one machine that never show the UAC notification message, even though I set the User Account Control to Always notify me
.
When checking the code on that machine, even if I choose run as administrator
, it doesn't work and the method IsProcessElevated
returns false.
Is something wrong with that specific machine?
Is there a way to determine whether a user is elevated or not, on that kind of platform?