alexxx73 Posted July 2, 2009 Posted July 2, 2009 Hello everyone. The first thing I want is to ask forgiveness for my English, but I'm Spanish. Regarding the question, I searched around the forum, but I have not found how to do it. I use AutoIT3 and what I want is to launch a vbs with administrator permissions. I use this ... Runas ($sUserName, @ComputerName, $sPassword, 0, "cscript.exe " & @ScriptDir & "\script.vbs") But it does not work. Any help? Thanks and gracias!! :-)
DCCD Posted July 2, 2009 Posted July 2, 2009 VBScript UAC elevation Set objSh = CreateObject("Shell.Application") objSh.ShellExecute "notepad.exe", "" , "", "runas", 1 [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group
alexxx73 Posted July 2, 2009 Author Posted July 2, 2009 (edited) VBScript UAC elevation Set objSh = CreateObject("Shell.Application") objSh.ShellExecute "notepad.exe", "" , "", "runas", 1 Thanks, i use it, but ask me the user and the pass and then open notepad I want to create a .exe who launch a vbs with admin permission. (The user and pass should be inside the .exe) Thanks a lot! Edited July 2, 2009 by alexxx73
DCCD Posted July 2, 2009 Posted July 2, 2009 like this! #Include <WinAPI.au3> ; $File = "yourfile.vbs" $App = "WScript.exe " ; Local $sUserName = "User" Local $sPassword = "Passwd" ; RunAs($sUserName, @ComputerName, $sPassword, 0, $App & $File, @SystemDir) ; MsgBox(0,"last message!!",_WinAPI_GetLastErrorMessage()) [u][font=Arial Black]M[/font]y Blog, AVSS Parts[/u][font=Arial Black]Else[/font][font=Arial Black]L[/font]ibya Linux Users Group
alexxx73 Posted July 2, 2009 Author Posted July 2, 2009 its does not work... :_( thanks for try any idea?
alexxx73 Posted July 2, 2009 Author Posted July 2, 2009 (edited) its does not work... :_( thanks for try any idea? I have the solution!!! The problem was with "" and ' This works.... Local $sUserName = "User" Local $sPassword = "Passwd" RunAs($sUserName, @ComputerName, $sPassword, 0, 'wscript.exe "' & @ScriptDir & '\script.vbs"') Regards Edited July 2, 2009 by alexxx73
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now