I am trying to run a .bat file from my java code and I'm using the ProcessBuilder.java functionality as follows:
String[] hubCmd = new String[]{"cmd.exe", "/C", "startHub.bat"};
ProcessBuilder pbHub = new ProcessBuilder(hubCmd);
pbHub.directory(new File("C:\\java\\selenium\\"));
Process hubP = pbHub.start();
This seems to work, kicks of a java process and associated cmd process, but the command window is not displayed. Am I missing something or is this correct functionality?
Thanks in advance.
Runtime.getRuntime().exec("cmd.exe /C start");this probably should display the command window