如何将命令行参数传递给AHK脚本?


Answers:


1

命令行参数存储在变量中%1%%2%依此类推。例如:

MsgBox, %1%, %2%

从版本v1.1.27 +开始,输入参数作为数组存储在内置变量中A_Args作为数组

这是一个例子:

for n, param in A_Args  ; For each parameter:
{
    MsgBox Parameter number %n% is %param%.
}

旧版:命令行参数也存储在变量中%1%%2%依此类推,如[v1.1.27]之前的版本。另外,%0%包含传递的参数数量(如果没有则为0)。但是,这些变量不能直接在表达式中引用,因为它们将被视为数字而不是变量。

来源:将命令行参数传递给脚本

By using our site, you acknowledge that you have read and understand our Cookie Policy and Privacy Policy.
Licensed under cc by-sa 3.0 with attribution required.