"Go" vc++mcf/c++/c how to get an application or run with Administrator privileges, ShellExecuteEx programming---get Administrator privileges

Source: Internet
Author: User
Tags change settings

ShellExecuteEx Programming---Get Administrator privileges: http://blog.csdn.net/jhui163/article/details/5873027

How to get administrator privileges for your application: Run as an administrator when running development tools such as vc6.0 or VS2010, so your application can inherit

http://bbs.csdn.NET/topics/390262991

Solution: In the development tools such as VS2010, although the program is compiled as administrator, you can get administrator rights, but when you click Debug or release version alone, it seems that no administrator rights, the first click No, the second time to get administrator rights

Method One:

1 shortcut to find VS2010: Right-click--"Open File location"
Find the startup Project for VS2010 devenv.exe: Right-click--Properties--compatibility--privilege level, run as administrator, or "Change settings for all users"--privilege level, run with administrator privileges if you want each user to run with administrator privileges.
Then make sure to open the program as VS2010 by default in the way the project is opened.

2 Properties--connector--Manifest file-"UAC execution Level-" requireadministrator (/level= ' requireadministrator ')

Method Two

Manifest file: Create a manifest file such as App.mainfest, add a manifest file to the project (properties--connectors--manifest file)
<?xml version= "1.0" encoding= "UTF-8" standalone= "yes"?>
<assembly xmlns= "urn:schemas-microsoft-com:asm.v1" manifestversion= "1.0" >
<assemblyidentityversion= "1.0.0.0" processorarchitecture= "X86" name= "Vistalogodemo" type= "Win32"/>
<description>description of your application</description>
<!--Identify the application security requirements.-->
<trustinfoxmlns= "Urn:schemas-microsoft-com:asm.v3" >
<security>
<requestedPrivileges>
<requestedexecutionlevellevel= "Requireadministrator" uiaccess= "false"/>
</requestedPrivileges>
</security>
</trustInfo>
</assembly>
Reference Link: http://blog.csdn.Net/penglijiang/article/details/7178594

from:http://blog.csdn.net/zhangyulin54321/article/details/8802023

"Go" vc++mcf/c++/c how to get an application or run with Administrator privileges, ShellExecuteEx programming---get Administrator privileges

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.