http://msdn.microsoft.com/en-us/library/bb756929.aspx
可以在VS2008中设置当执行exe时弹出提升管理员权限对话框:
xx Property->Configuration Properties->Linker->Manifest File,把UAC Excecution Level 项设置为 requireAdministrator 即可。
更多请参考:http://subject.it168.com/article/articleview.aspx?id=734216
Value |
Description |
Comment |
---|---|---|
asInvoker |
The application runs with the same access token as the parent process. |
Recommended for standard user applications. Do refractoring with internal elevation points, as per the guidance provided earlier in this document. |
highestAvailable |
The application runs with the highest privileges the current user can obtain. |
Recommended for mixed-mode applications. Plan to refractor the application in a future release. |
requireAdministrator |
The application runs only for administrators and requires that the application be launched with the full access token of an administrator. |
Recommended for administrator only applications. Internal elevation points are not needed. The application is already running elevated. |