I start a program A using Windows Task Scheduler. That program starts instances of another program B. The task is started on Windows startup and runs even if no user is logged on.

When I terminate the task in the Task Scheduler using "right click/end" the program A is terminated but the instances of program B continue running.

The instances of B could be terminated by stopping program A with ctrl+c or by using taskkill /t.

Can I tell the Task Scheduler to use one of the above options when ending the task?

  • Personally, I think I'd create a new task which does what you want... Write a bat file which kills the running tasks
    – Dave
    May 21 '15 at 7:30
  • Then you start that terminating task to stop program A and B, end it and end the original task? That would work but seems a bit cumbersome.
    – telandor
    May 21 '15 at 7:36
  • I see that it is quite customized. But Task Scheduler doesn't necessarily need to know what other tasks are connected to the started program. Task Scheduler would simply need to provide the possibility to call a program when ending a task. So I could call the program taskkill for example. But of course Microsoft had to stop somewhere adding features.
    – telandor
    May 21 '15 at 8:04
  • Not exactly. Sorry for the misunderstanding. I would like to tell Task Scheduler to do something additional when ending a task. When I right click a task and click on "end" it would be great if the Task Scheduler could do something customizable - such as calling a program - before ending the task.
    – telandor
    May 21 '15 at 8:14
  • Is it possible to end a task in the Task Scheduler from a batch file? How can this be done?
    – telandor
    May 21 '15 at 8:51

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.