Search code examples
autoit

Why doesn't my AutoIt script process its command line argument?


I want to send a variable to the edit control of a GUI using AutoIt. How can I run my AutoIt script from command line or using shellexecute so it correctly processes its command line parameters?

I am using the below syntax in my AutoIt script:

Send("2{TAB}$CmdLine[1]")

And the below command to run the compiled AU3 script:

tstScript.exe 888

Solution

  • It should work if you concatenate the commandline parameter with the send String as follows:

    Send("2{TAB}" & $CmdLine[1])