Thank you guys for the reply but the parameters are still not being passed.
I understand that you are supposed to pass the parameters to the AutoIt exe by calling the Runtime.getRuntime().exec(exeLocation, cmdArray) and then AutoIt exe will use the cmdArray that was passed as the $CmdLine array that I call in the script, yet I am still getting an issue
I changed up the script code to explicitly print each value of the $CmdLine array, but only the first line gets called and the result is incorrectly "0". On top of that, the other two message box's don't even appear. Am I doing something wrong?
My Java Code:
public class test {
public static void main(String[] args) throws I0Exception, InterruptedException
{
String[] cmd = {"test", "testl", "test2"};
Runtime.getRuntime().exec("C:/Users/Eamon/Desktop/test.exe", cmd);
}
}
My Autoit Script code:
#include <Word.au3>
#include <MsgBoxConstants.au3>
MsgBox(0, "First Argument", $CmdLine[0])
MsgBox(0, "First Argument", $CmdLine[1])
MsgBox(0, "First Argument", $CmdLine[2])
Resulting msg box: