title: Want to hide command prompt window in using WshShell.Exec method
body: <p>I want to execute a java program from a javascript and want to get the output.</p>
  
  <p>Intailly i tried with below code:</p>
  
  <pre><code>WshShell = new ActiveXObject("WScript.Shell");
  var launch="cmd.exe /c java -classpath . HelloWorld ";
  var cmdRun = WshShell.Run(launch,0,true);
  </code></pre>
  
  <p>Through Run method i am not able get the output of the class.</p>
  
  <p>Then i tried with below code:</p>
  
  <pre><code>WshShell = new ActiveXObject("WScript.Shell");
  var launch="cmd.exe /c p java classpath . HelloWorld ";
  var cmdRun = WshShell.Exec(launch);
  while (cmdRun.Status == 0) // wait for the command to finish
  {
  sleep(100);
  }
  var output = cmdRun.StdOut.ReadAll();
  alert(output);
  </code></pre>
  
  <p>Now i am able to get the output in variable output.</p>
  
  <p>My problem is using Run method i can hide the commandprompt(by passing parameters WshShell.Run(launch,0,true))
  Where as by using Exec method i am not able to hide the commandprompt. I want this commandprompt to be hidden.</p>
  
  <p>Can you please help me in this regard?
  Thanks </p>