title: How to write a batch file to open applications and close them if they are already open
body: <p>I have already read how to write a .bat file in Windows 7 to open programs but what i want to do now is to have that same .bat to close them if they are already open.</p>
  
  <p>Let's say i run the batch file to open these applications at once to save me some clicks, after i'm done with my work i want to close them without having to go to each one and close them individually. So i want to have the same batch file check if one or all the applications it executed are open to kill their processes like i would do in the Task Manager.</p>
  
  <p>This is the code i'm using in the .bat file:</p>
  
  <pre><code>start "" "C:\Program Files\RocketDock\RocketDock.exe"
  start "" "C:\Users\user\Random Folder\Programs\RK_Launcher_04_Beta\RKLauncher.exe"
  </code></pre>