Click here to Skip to main content
15,919,931 members
Please Sign up or sign in to vote.
5.00/5 (2 votes)
See more:
I am launching one exe in (local) user account in windows 7.
The exe will have info about the local admin account(Credentaials).
Using this i need launch one more exe with admin privileges.
How do achieve this in windows 7.
Posted

On Windows 7, running application under administrator account is not enough. Additionally, you need to launch application "As Administrator". Yes, this is a total terminological absurd, but 1) this is really how things work, 2) this conception and feature is actually very good. I would prefer to call it "privilege elevation". This is related to what is called "UAC":
http://en.wikipedia.org/wiki/User_Account_Control[^].

Now, let me clarify what I mean by running "As Administrator", or elevation. This:
http://www.sevenforums.com/tutorials/11841-run-administrator.html[^].

Apparently, it is impossible to programmatically elevate privileges, no matter what you do, because otherwise it would mean that UAC is impossible. One thing you can do is to force elevation from the very beginning, which would show a UAC confirmation dialog without clicking on "Run As Administrator". This is done by adding and properly configuring application manifest. This is how:
http://msdn.microsoft.com/en-us/library/bb756929.aspx[^].

—SA
 
Share this answer
 
Check this link. This is using C# I am not sure if same API are available in C++.


http://stackoverflow.com/questions/6413900/launch-a-process-under-another-users-credentials[^]
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900