title: How to execute multiple windows commands using Runtime class in java
body: <p>I am trying to execute windows commands from Java using the following code,</p>
  
  <pre><code>Process p=Runtime.getRuntime().exec("wget www.anyurl.com/index.html);
  </code></pre>
  
  <p>and it works but when I try to execute another command which is as follows,</p>
  
  <pre><code>Process p1=Runtime.getRuntime().exec("pscp -pw sysadmin c:/mydirectory/mypage.html mahesh@vmstni01:/home/usr");
  </code></pre>
  
  <p>it does not seem to work.  If I comment out the first process line (ie Process p) then the process p1 is working fine, it executes and shows that file has been copied successfully. Please can anyone tell me why this is happening?   </p>