maqleod Posted May 19, 2007 Posted May 19, 2007 is there anyway to write a script that can accept commands from the command line? There are a few programs I want to write that are too simple to need a gui, and it would just be nice to be able to call it in a cmd prompt with arguments to do what I want. [u]You can download my projects at:[/u] Pulsar Software
Emperor Posted May 19, 2007 Posted May 19, 2007 The help file contains some nice examples on using the command line.Take a look at it here: http://www.autoitscript.com/autoit3/docs/i...htm#CommandLine
lordofthestrings Posted May 21, 2007 Posted May 21, 2007 I did it like this: Func getNamedArgument($NamedArgument) For $i = 1 to $CmdLine[0] If stringinstr($CmdLine[$i],$NamedArgument) Then $TmpArray = StringSplit($CMDLINE[$i],':') Global $return = $TmpArray[2] EndIf Next EndFunc you can call this function easy: getNamedArgument("/CommandLineSwitch:") $CommandLineSwitch = $return
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