title: Unable to run a .bat file in java program
body: <p>Problem Statement: I just want to start the HUB and Node to perform some tests using Selenium Grid.
  I have two Batch files START HUB.bat and START NODE.bat which run perfectly when i manually run them.
  But i want them to run using a Java Program @BeforeMethod.
  I looked for answers</p>
  
  <pre><code>    Runtime.getRuntime().exec("cmd /C start \"./BatchFiles/START HUB.bat\"");
  </code></pre>
  
  <p>This Opens Up the CMD but goes to the path of my .git project but doesnt run the bat file.</p>
  
  <p>I tried using Process Builder but that doesn't open the cmd.</p>
  
  <pre><code>    ProcessBuilder pb = new ProcessBuilder("cmd", "/C"," start", "START HUB.bat");
      File dir = new File("D:\\work\\GIT REPOSITORY\\project.selenium.maven.jenkinsCI\\BatchFiles");
      pb.directory(dir);
      Process p = pb.start();
  </code></pre>
  
  <p>Can someone please help me with this issue. Below are the commands in the batch file.</p>
  
  <pre><code>    D:
      cd work
      java -jar selenium-server-standalone-3.4.0.jar -role hub
  </code></pre>