954,496 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Have something to say? Contribute New Article Reply to this Article

Execute Command As Administrator

Okay, so I have to execute a batch command on a restricted user's account, however the batch command will not work unless the process has Administrative Privileges.

currently i call the batch command via

system("command here");


I, as the programmer, know the Administrator user/password on the WinXP machine this is to be executed on.

How can i execute this command/program as an administrator? I'm thinking about using the
SetThreadToken() function ( http://msdn.microsoft.com/en-us/library/aa379590%28VS.85%29.aspx ) but I do not know how to construct the token object properly

Thanks,
Philly0494

Philly0494
Newbie Poster
1 post since Nov 2009
Reputation Points: 10
Solved Threads: 0
 
Ancient Dragon
Retired & Loving It
Team Colleague
30,049 posts since Aug 2005
Reputation Points: 5,662
Solved Threads: 2,343
 

This article has been dead for over three months

Post: Markdown Syntax: Formatting Help
You