Search code examples
windows-task-scheduler

Task scheduler on windows server


I want to schedule a task which runs every 15 min during weekdays only. I've got the weekly option but confused what should I put in Recure every? As I want to run this indefinitely till I manually stop it. Thanks in advance.


Solution

  • Even though the Create New Scheduled Task Wizard only lets you specify a single simple schedule, a single Task can still have multiple schedules, which you can configure after the task is created.

    1. Open Task Scheduler > (your task) > (right-click) > Properties > Triggers
    2. Then add remove the default trigger you set in the wizard.
    3. Then add 5 separate schedule triggers for Mon, Tue, Wed, Thu, Fri as follows:
      • Begin the task: On a schedule
      • Weekly
      • Start: Midnight of tonight.
      • Recur every: 1 weeks
      • On (a single day corresponding to the trigger, so choose Monday for the first one).
      • Advanced settings:
        • Repeat task every 15 minutes
          • ...for a duration of 1 day
          • [X] Stop all running tasks at end of repetition duration (just for safety)
        • [X] Stop task if it runs longer than (X minutes) (also for safety)
        • (Ensure "Expire" is unchecked)
        • [X] Enabled
    4. Repeat Step 3 for Tuesday, Wednesday, Thursday and Friday.

    So at the end, you should have something like this:

    enter image description here