title: How to stop a process automatically via a batch script
body: <p>How can I check if a process is running from a batch/cmd file? And If process is running, how do I stop the process automatically?</p>
  
  <p>Like a cmd script thingy, can someone give me some hints or help me make that kind of script.</p>
  
  <p>Example (pseudo code):</p>
  
  <pre><code>If calc.exe is running                        
  Stop calc.exe
  </code></pre>
  
  <p>I want something like this:</p>
  
  <pre><code>@echo off
  
  :x  
  PATH=C:\Windows\System32\calc.exe  
  If calc.exe is ON goto Process_Stop
  
  :Process_Stop  
  net stop calc.exe  
  goto x
  </code></pre>