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