Windows Application Run Permissions settings

Source: Internet
Author: User

In later versions of Windows in Vista, there are times when you need to elevate the post-build program's permissions to let the generated program run as an administrator. Although in general, you can use the right mouse button to choose the way to run as an administrator, but it does not block the normal running mode, and ordinary people usually do not use right-click to run as an administrator, so the program must be built to restrict the program to run as an administrator.

To put it simply, in the later versions of Windows, Microsoft introduced the UAC mechanism, which is designed to prevent the program from maliciously tampering with the operating system itself. For a program to run as an administrator, you need to introduce UAC annotations in your program, which means that the program displays "UAC Shields."

  

  VS2008 set the application chain to be delivered to UAC settings: Linker->manifest File

  

UAC execution Level Optional parameters:

0: asInvoker: The application will run with the same permissions as the process that started it. You can promote the application to higher permissions by selecting Run as Administrator.

1: highestavailable: The application will run with the highest possible permission level. This option is the same as Requireadministrator if the user who launches the application is a member of the Administrators group. If the highest permission level available is higher than the level of the open process, the system will prompt for credentials.

2: requireadministrator: The application will run with administrator privileges. The user who launches the application must be a member of the Administrators group. If the open process is not running with administrative rights, the system will prompt for credentials.

/MANIFESTUAC (embedding UAC information in the manifest)

Windows Application Run Permissions settings

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.