3

I have a Scheduled Task running on a Windows 2008 R2 server.

The task calls a .bat file that performs a file copy.

Everything works perfectly except for one thing. I want the task to terminate if it takes longer than a certain period of time. When I enable 'Stop the task if it runs longer than:' (in the Settings tab) and enter a time limit, this just gets ignored. To test whether the stop works, I have added a delay in the batch file to cause it to sleep for a while.

The task is configured to run as a local user (not the administrator) and as mentioned earlier, everything works perfectly except for the termination of the job if it takes too long to run.

Any help would be hugely appreciated!

1

Does the task sxheduler actually show stopped, but the process is still running? If so you might need to redo your script so it doesn't shell out to another process that isn't under the control of task scheduler. Some processes get stuck trying to be terminated. But a simple file copy should be easy enough for task scheduler to kill.

1
  • The Task Scheduler shows the task as 'Running' and looking in Task Manager, I can see an active cmd.exe process. – Chris Driver Mar 17 '14 at 10:38

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.