title: Open and close applications from Java
body: <p>I want to make a program to open and close applications you have installed on your computer.</p>
  
  <p>I know that using </p>
  
  <pre><code>Runtime.getRuntime().exec("rundll32 SHELL32.DLL,ShellExec_RunDLL "+"M:\\myfile.doc"); 
  </code></pre>
  
  <p>open the Word document myfile.doc</p>
  
  <p>The problem is using this command can not close the Word application that opens when you execute the command.</p>
  
  <p>How I can open and close applications from a java program?</p>
  
  <p>Thank's!</p>
  
  <p>Regards!</p>