bobuk Posted June 26, 2006 Share Posted June 26, 2006 I am new to autoit but have been using vbscript for a while. I need some help with this. I want to use the RunAsSet and compile it as an executable but I would like the executable to take some varialbles, if possable. IE: AppInstall.exe -PATH -PASSWORD where:- PATH = path of executable to run PASSWORD = of user with rights to install RunAsSet("adminuser", @Computername, "PASSWORD") RunWait('PATH') RunAsSet() Link to comment Share on other sites More sharing options...
MHz Posted June 26, 2006 Share Posted June 26, 2006 Hi bobuk,Command Line Parameters.; Check $CMDLINE[0] for parameter count If $CMDLINE[0] = 2 Then ; Assign 1st parameter to $path $path = $CMDLINE[1] ; Assign 2nd parameter to $password $password = $CMDLINE[2] ; RunAsSet("adminuser", @Computername, $password) RunWait($path) RunAsSet() EndIf$CMDLINE is reserved for incoming parameters and used as an array. Test against $CMDLINE[0] for array count before attempting to use the array. Link to comment Share on other sites More sharing options...
bobuk Posted June 26, 2006 Author Share Posted June 26, 2006 Hi bobuk, Command Line Parameters. ; Check $CMDLINE[0] for parameter count If $CMDLINE[0] = 2 Then ; Assign 1st parameter to $path $path = $CMDLINE[1] ; Assign 2nd parameter to $password $password = $CMDLINE[2] ; RunAsSet("adminuser", @Computername, $password) RunWait($path) RunAsSet() EndIf $CMDLINE is reserved for incoming parameters and used as an array. Test against $CMDLINE[0] for array count before attempting to use the array. Thanks, wow, it is so easy. I think I will be using AutoIT more and more. Link to comment Share on other sites More sharing options...
MHz Posted June 26, 2006 Share Posted June 26, 2006 (edited) That is OK. I would recommend AutoIt along with your VBScript use. You can make use of AutoitX.dll that comes along with the standard AutoIt install to enhance your VBScripts where needed also.Ensure you get yourself a copy of the Beta AutoIt Installer which has Com, ActiveX and StdOutRead/InWrite handling added.Edit: In case Nutster reads this, Autoit Beta has inbuilt Regular expressions support and all the rest I may have failed to credit. Edit2: Out and In as in summary above for STD?Read/?Write... Edited June 26, 2006 by MHz Link to comment Share on other sites More sharing options...
MrSmiley Posted June 26, 2006 Share Posted June 26, 2006 Edit: In case Nutster reads this, Autoit Beta has inbuilt Regular expressions support...WOOHOO! Link to comment Share on other sites More sharing options...
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