title: Task scheduler, terminate started program in windows
body: <p>At my work we have a set up with the task scheduler periodically starting a java program to read mails.
  the task is scheduled to run every minute and it calls a .bat file which starts the java program.</p>
  
  <p>Now the problem.
  Once in a month or so the jave.exe process doesn't end properly, so the next minute when it tries to run I get:</p>
  
  <p>Task Scheduler failed to start "\XXX Jobs" task for user "NT AUTHORITY\System". Additional Data: Error Value: 2147750687.</p>
  
  <p>And then I get that message every minute until I terminate the java.exe from the task manager.</p>
  
  <p>Now my question, in task scheduler there are some options to choose. 
  Under settings there is "If the task is already running, then the following rule applies"
  If I then choose "Stop the existing instance"
  Will this stop the java.exe or just the task? Or is there a better way.</p>
  
  <p>Some advice would be welcome. </p>