title: How to run CMD commands from springboot service?
body: <p>I'm able to run same code through a normal java class. However when I move same code to a service class in springboot, and call the service from controller on a hit of url, the command doesn't run or gets stuck for a long time. </p>
  
  <pre><code>    Process process = new ProcessBuilder("CMD", "/C", command2).start();
      .
      .
      .
      process.waitFor();
      process.destroy();
  </code></pre>
  
  <p>Tried a lot of times and different ways, still not able to find the solution.</p>
  
  <p>command is        </p>
  
  <pre><code>"tool --f pathToFile".
  </code></pre>