Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Skip an upcoming scheduled task just once using cmd

I'm in the process of automating the daily shutdown of the computers in my school's network. So far I have a batch file which works nicely and I would like to schedule it to run every day at a specific time, however occasionally I may want to skip the task just for the day without permanently disabling it.

I found plenty of information on creating, modifying, disabling and deleting scheduled tasks using cmd, but I found nothing regarding skipping them just once... Seeing as I am not the only person who would have to skip the task on occasion, it is quite important that it can be skipped using a batch file so that the slightly less computer-savvy people won't have to mess around with the task scheduler.

If the worst comes to the worst I could always have a batch file disable the task and have it schedule a separate task to re-enable the shutdown task after the time it runs at has passed, however it seems like a rather cumbersome solution and I would greatly appreciate any suggestions!

like image 239
Bets Avatar asked Dec 14 '14 16:12

Bets


1 Answers

The easiest solution is actually to just go to Task properties > Triggers, and change the "first trigger" or start date to a future date, beyond the next Run.

So if the next Run is Today at 10pm set it to start at 10:01pm Today or tomorrow. And that's it.

like image 85
konung Avatar answered Oct 01 '22 00:10

konung