How to schedule a task to run every x-minutes on Windows Server 2003 R2

scheduled-tasktask-schedulerwindows-server-2003

How to add a scheduled task that should run every x-minutes on Windows Server 2003 R2.

I have followed many suggestion from the web, but I always end up with some interruption after 1 or 2 runs.

Here is what I did:

  1. New Scheduled Task

  2. Schedule > Daily Task 08:00 AM, every 1 day

  3. Schedule > Advanced > Repeat task every 30 minutes, duration 31 minutes (why???)

  4. Enabled it

Not working after 1 run and the next run time is +1 day at 08:00 AM

How to fix this problem?

Best Answer

It sounds like the task might not be completing successfully, and multiple instances of the task might be trying to run at the same time.

Open up Scheduled Tasks from the Control Panel.

Right click on the task you've created and click "Properties."

Navigate to the "Schedule" tab.

Choose the start time (00:10 AM)

Make sure that Schedule Task Daily is set to Every 1 day(s).

Click Advanced.

Check the "Repeat Task" checkbox.

Until: (select bullet) Time: (enter 11:59 PM) and click "OK"

Open the "Settings" tab now.

[Check] Stop the task if it runs for: [0] hour(s) and [9] minute(s). Click "OK" This will prevent multiple instances of the scheduled task from running at the same time, possibly causing the conflicts you've described.

If the scheduled task is set to run every 30 minutes, set it to stop the task after 29 minutes (in case it hangs for some reason).

If this is the problem you'll want to look at what your task is doing, and see what might be causing it to hang. A successfully executed task will exit with Last Result = 0x0.