Click here to Skip to main content
Click here to Skip to main content

Is Your App Running As Administrator?

By , 19 Jan 2011
 
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)

About the Author

Sam Cragg
United Kingdom United Kingdom
Member
No Biography provided

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
Hint: For improved responsiveness ensure Javascript is enabled and choose 'Normal' from the Layout dropdown and hit 'Update'.
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
GeneralMy vote of 1membervijayksingh19 Feb '13 - 17:58 
GeneralReason for my vote of 5 good to knowmemberjohannesnestler2 Mar '12 - 1:36 
GeneralReason for my vote of 5 Good alternative...memberPravin Patil, Mumbai1 Nov '11 - 18:52 
GeneralMaybe both approaches are valid. If the windows can't unders...memberdanlobo18 Oct '11 - 2:42 
Maybe both approaches are valid. If the windows can't understand what the manifest means (since is recent. XP, maybe?), saying programmatically to the user to raise the privileges would be another option.
GeneralYeah, I knew about this, but I don't want the UAC to pop up....mvpJohn Simmons / outlaw programmer24 Jan '11 - 23:46 
GeneralRe: Fair point, both methods ultimately lead to the same result ...memberSam Cragg25 Jan '11 - 2:30 
GeneralReason for my vote of 5 because I learned new way about chec...mvpRaviRanjankr22 Jan '11 - 6:42 
GeneralReason for my vote of 5 Very much needed thing...memberPravin Patil, Mumbai20 Jan '11 - 21:52 
GeneralReason for my vote of 5 Good to learn about something I can ...memberChris Trelawny-Ross20 Jan '11 - 7:05 

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

Permalink | Advertise | Privacy | Mobile
Web01 | 2.6.130516.1 | Last Updated 19 Jan 2011
Article Copyright 2011 by Sam Cragg
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid