Note that the script filename does not count as a parameter, and if you want to get the script file name, see the description of the @ScriptName. If an argument contains an empty characters, you must enclose the argument in English "double quotes". The compiled script also receives command-line arguments in the same way.
$CmdLine [0] holds the number of arguments in the command line (not including the script file name)
$CmdLine [1] is the 1th parameter
$CmdLine [2] is the 2nd argument
...
We often $CmdLine [$CmdLine [0]] to represent the last argument ...
If your script is being run as follows:
AutoIt3.exe MYSCRIPT.AU3 Parameter 1 "This is a string parameter"
$CmdLine [0] is equivalent to ... 2
$CmdLine [1] is equivalent to ... Parameter 1
$CmdLine [2] is equivalent to ... This is a string type parameter
@ScriptName equivalent to ... myscript.au3
In addition to the $cmdline, there is a variable called $CmdLineRaw, which holds the complete command line statement that is not split, for the above example
$CmdLineRaw equivalent to ... myscript.au3 parameter 1 "This is a string parameter"
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.