VS set the compiled program to run as Administrator

Source: Internet
Author: User

1. First, create a file named XXX.exe.manifest, and copy the following to the file

<?xml version="1.0"encoding="UTF-8"Standalone="Yes"?> <assembly xmlns="urn:schemas-microsoft-com:asm.v1"manifestversion="1.0"> <assemblyidentity version="1.0.0.0"processorarchitecture="x86"name="J2534ToolDemo.exe.manifest"     //different projects, only need to modify the project name hereType="Win32"/> <trustinfo xmlns="Urn:schemas-microsoft-com:asm.v3"> <security> <requestedPrivileges> <requestedexecutionlevel level="requireadministrator"uiaccess="false"/> </requestedPrivileges> </security> </trustInfo> </assembly>


2. Then import this XXX.exe.manifest into the resource view

Directly select "Import (M) ..."

Find the XXX.exe.manifest file to import in the project

Here, add the resource type of the import file, set to "Rt_manifest", and then "OK"

In the end, it shows up in the resource view.

3. First configure the project properties

Project-"XXX Properties-" Configuration Properties-"linker-" manifest file


Recompile, and then choose Run vs with Administrator privileges, the system will turn off the existing vs editor to open again with administrator privileges, and then the manually compiled application is automatically run with Administrator privileges ...

VS set the compiled program to run as Administrator

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.