3

We would like to scheduled a task on Windows Server on all weekdays. At the same time, the task should be disabled on the holidays. Please advise.

5
  • The tricky thing might be how task scheduler knows its a holiday. I can't think of any cron-like system that is aware of this. Oct 12, 2012 at 11:09
  • May be, can we have a annual maintenance activity to disable the activity for those holidays?
    – user47289
    Oct 12, 2012 at 11:31
  • 1
    Might want to add the version of windows to your question. Task scheduler on newer and older version of windows are VERY different. Oct 12, 2012 at 11:47
  • OS Version : Win 2003 Server Enterprise edition
    – user47289
    Oct 19, 2012 at 8:48
  • What is the need for this? On Business holidays and weekends, we do not want to run a process.
    – user47289
    Oct 19, 2012 at 8:49

4 Answers 4

3

If this is a Windows Server 2008 - you can try the below from the Task Scheduler -

Screenshot for the Task Scheduler Trigger window pane

You can then uncheck the days you dont want the task to run as I have highlighted in blue.

I believe this is what you are looking for...

1

Well, One way I see to do this is to the task to end on a holiday, then have a second task starting on the next working day, and ending that task the next holiday. Rinse and repeat per holiday.

enter image description here

The newer versions of task scheduler does seem to let you string events together, but I don't see any option not to run a task on a specific day.

3
  • This looks cool. Say we have 10 business holidays, then will have 10 scheduled tasks. Thanks a lot.
    – user47289
    Oct 19, 2012 at 8:51
  • Could please give more info on string events together on the new task scheduler.
    – user47289
    Oct 19, 2012 at 9:00
  • On windows 7 (I don't have server 2012) You can set multiple triggers for the same task - so 10 triggers rather than 10 separate tasks under create tasks. Create basic tasks is closer to the options windows XP does. Oct 19, 2012 at 9:47
0

I understand this is a rather old question, but I had the same question. I have an autodialer program that runs via the task scheduler. For obvious reasons I do not want it to run on holidays. My customers would be unhappy if I called them on a holiday.

My solution to the problem is simple. I created another task for the holidays. It runs a powershell script that disables the autodialer task. Once the holiday is over another task is run to re-enable the the task.

The powershell function that I use is Disable-ScheduledTask.

Disable-ScheduledTask -TaskName "AutoDialerStart" Enable-ScheduledTask -TaskName "AutoDialerStart"

-2

Better answer to what has already been suggested. Set multiple triggers but do it by month so separate trigger for each month and you can choose which days to run. Triggers will be checked sequentially and if they meet the date requirement, that specific trigger will run. Holidays and weekends can be left unselected. At the beginning of each year you would need to reset the days for each trigger you want the task to run but you can call that yearly maintenance. Or hell, set the triggers out for three years or so.. Whatever works for you.

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .