Sign in to follow this  
Followers 0
TheGeneral

How can I run any program as administrator (vista option)

4 posts in this topic

I have some programs that i would like to run as administrator, because without this rights it doesn't work properly. First of all there's only a user in my system, named: The General, and it has admin rights. I tried to use RunAs but I get @error = 1. I tried to use #requireadmin for the script, but it didn't make the script to run the programs as admin. So i would like to know if it's possible. And if it's how?

Share this post


Link to post
Share on other sites



Yeah, it makes the programs run as admin if you have #RequireAdmin. Show some code.

Share this post


Link to post
Share on other sites

Yeah, it makes the programs run as admin if you have #RequireAdmin. Show some code.

#RequireAdmin
AutoItSetOption ( "WinTitleMatchMode", 2 )
Run ( "C:\Program Files (x86)\Silkroad\Loader.exe")
WinWaitActive("Testosterone")
ControlCommand( "Testosterone", "", "Button6", "Check", "" )
ControlClick ( "Testosterone", "", "Button8" )
WinWait ("SRO_Client")
$PID2 = WinGetProcess ("SRO_Client")
ProcessSetPriority ( $PID2, 3)

Autoit does not run Loader.exe as admin

Share this post


Link to post
Share on other sites

Hi, sorry about double post but there's no way to delete or edit the old one. So i tried to change:

#RequireAdmin
AutoItSetOption ( "WinTitleMatchMode", 2 )
Run ( "C:\Program Files (x86)\Silkroad\Loader.exe")
WinWaitActive("Testosterone")
ControlCommand( "Testosterone", "", "Button6", "Check", "" )
ControlClick ( "Testosterone", "", "Button8" )
WinWait ("SRO_Client")

For

#RequireAdmin
AutoItSetOption ( "WinTitleMatchMode", 2 )
ShellExecute("C:\Program Files (x86)\Silkroad", "", "", "", @SW_MAXIMIZE )
WinWaitActive ( "Silkroad" )
MouseClick ( "left", 204, 328, 2 ) [b]-----> Click on Loader.exe[/b]
WinClose ( "Silkroad")
WinWaitActive ( "Testosterone" )
ControlCommand ( "Testosterone", "", "Button6", "Check" )
ControlClick ( "Testosterone", "", "Button8" )

And it worked, now loader.exe run with admin rights (UAC is disabled). I would like to know why Run isn't working with this specific program, I tried shellexecute too, and got the same problem. Thx for help

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0