I'm using Sikuli to execute my automated tests, and I'm writing a small java app for running my tests. I've searched for other answers but most of them relate to running batch scripts from java, I need to run the entire command from java.I have the following command to run Sikuli from cmd:
Process p = Runtime.getRuntime().exec("cmd /c start /wait C:\\Sikuli\\runIde.cmd -r C:\\Sikuli\\xmlRunner\\runners\\Runner.sikuli --args 5");
System.out.println("Waiting for command to be executed");
p.waitFor();
System.out.println("Command finished");
This starts a new cmd window and starts executing my script but when the script finishes, it does not close the cmd window. Is there a way to automatically close the cmd window when my script finishes running?