title: Batch file: Check for program, restart, or do nothing
body: <p>I'm struggling a bit with this. The idea of the script should be:</p>
  
  <p>If program 1 is running
  Close it then open it
  If not running
  Do nothing</p>
  
  <p>This will be used on XP and win7 machines</p>
  
  <p>Here's what I have, but I have no idea how to incorporate the if statements or even if what I have is remotely correct:</p>
  
  <pre><code>tasklist /fi "imagename eq KDS.exe" taskkill /f /im "KDS.exe"  start "" "C:\Path\KDS.exe"
  </code></pre>