Sign in to follow this  
Followers 0
stiwwy

How to pass an argument to a compiled AutoIt script?

3 posts in this topic

I am new to AutoIt so please forgive my ignorance. I have made a simple script that will locate for a control and then set a value on that control. For the sake of discussion, let's call this script as "SetControl.exe"

This script will require the following variables to be supplied by the user: $ControlName, $ControlValue.

How can I pass these variable inputs from command line? Something like "SetControl.exe Name Johnny"

What do I need to add on my setcontrol.exe script to accept "name" as the control name and "johnny" as the value to set on the "name" control.

thanks!

Share this post


Link to post
Share on other sites



use $CmdLine

$ControlName = $CmdLine[1]
$ControlValue = $CmdLine[2]

;It must pass both parameters.
MessageBox(0, $ControlName, $ControlValue)

Share this post


Link to post
Share on other sites

Read the help file and search for $cmdline.

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