-2
  1. A scheduled task runs every night to trigger a batch file. This batch file executes the application “AProgram.exe” with a configuration file to import data into a system. Occasionally this program fails to exit properly, leaving a “headless” process behind. When the scheduled task runs again the following night, the error below is produced: [ERROR] PROCESS ALREADY RUNNING We believe adding the command “taskkill” into this batch file should prevent this error from occurring again. Add the “taskkill” command with any required parameters into the batch file below to force “AProgram.exe” to end before it runs again, along with any other commands you deem necessary.
nobody
  • 19,814
  • 17
  • 56
  • 77

1 Answers1

0

from dos prompt type : Taskkill /? this will explain all possible scenarios.

i think that the correct solution for your problem is to add in batch script :

TASKKILL /F /IM AProgram.exe /T

/F : For FORCE the end of task /T : terminate all child process

Ven
  • 68
  • 6