I am executing a .exe file from Java using the ProcessBuilder class and the Process class. To explain what I am doing:
builder = new ProcessBuilder(commands); builder.redirectErrorStream(true); Process process = builder.start(); process.waitFor();
I just wanted to know how long to wait for "waitFor ()"? Is it waiting for my .exe to be executed, or is it waiting for its execution to finish?
My .exe is a compiled AutoIt script. This means that there may be interactions such as mouse movements that take some time. Therefore, I need to know whether the execution of my Java code continues after calling .exe or whether it really waits for it.
What I want to achieve is the rotational execution of two scripts, but I'm afraid that my Java code is executing the second script while the first is still executing. Does anyone have a workaround for this? I am happy for any ideas.
Kjaeg source share