Click here to Skip to main content
15,881,424 members
Articles / Programming Languages / C#
Alternative
Tip/Trick

Is Your App Running As Administrator?

Rate me:
Please Sign up or sign in to vote.
4.98/5 (25 votes)
19 Jan 2011CPOL 26.5K   19   10
You can also add an application manifest file. If you're using VS 2010, there's an option for one in the "Add New Item" dialog (right click on the project, click "Add" then click "New Item") and edit the generated file to uncomment the line that says:<requestedExecutionLevel ...
You can also add an application manifest file. If you're using VS 2010, there's an option for one in the "Add New Item" dialog (right click on the project, click "Add" then click "New Item") and edit the generated file to uncomment the line that says:

<requestedExecutionLevel  level="requireAdministrator" uiAccess="false" />


This not only forces the UAC dialog to open when you run the application, it also puts a little shield over your icon (well, in Windows 7 anyway).

There's a little more information on MSDN here.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
United Kingdom United Kingdom
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
GeneralMy vote of 1 Pin
Singh Vijay Kumar19-Feb-13 17:58
professionalSingh Vijay Kumar19-Feb-13 17:58 
GeneralReason for my vote of 5 good to know Pin
johannesnestler2-Mar-12 1:36
johannesnestler2-Mar-12 1:36 
GeneralReason for my vote of 5 Good alternative... Pin
Pravin Patil, Mumbai1-Nov-11 18:52
Pravin Patil, Mumbai1-Nov-11 18:52 
GeneralMaybe both approaches are valid. If the windows can't unders... Pin
danlobo18-Oct-11 2:42
danlobo18-Oct-11 2:42 
GeneralYeah, I knew about this, but I don't want the UAC to pop up.... Pin
#realJSOP24-Jan-11 23:46
mve#realJSOP24-Jan-11 23:46 
GeneralRe: Fair point, both methods ultimately lead to the same result ... Pin
Samuel Cragg25-Jan-11 2:30
Samuel Cragg25-Jan-11 2:30 
GeneralReason for my vote of 5 because I learned new way about chec... Pin
RaviRanjanKr22-Jan-11 6:42
professionalRaviRanjanKr22-Jan-11 6:42 
GeneralReason for my vote of 5 Very much needed thing... Pin
Pravin Patil, Mumbai20-Jan-11 21:52
Pravin Patil, Mumbai20-Jan-11 21:52 
GeneralReason for my vote of 5 Good to learn about something I can ... Pin
Chris Trelawny-Ross20-Jan-11 7:05
Chris Trelawny-Ross20-Jan-11 7:05 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.