Take the 2-minute tour ×
Server Fault is a question and answer site for professional system and network administrators. It's 100% free, no registration required.

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!

share|improve this question

1 Answer 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.

share|improve this answer
    
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 at 10:38

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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