Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

schtasks /create (Have a task that runs every day and repeats every hour

Sorry if this or similar has been asked, and I hope I'm missing something stupid and this is easy, but. How do I make a task using the schtasks /create command that will start say every day at 7 and repeat every hour either indefinitely or for the duration of a day?

If I do

schtasks /create /tn "test" /tr "\"C:\Program Files\test.exe"" /sc HOURLY /mo 1

it will only trigger if the specified date and time are hit.

If I do

schtasks /create /tn "test" /tr "\"C:\Program Files\test.exe"" /sc DAILY /mo 1

it will only trigger once a day.

Thanks in advance!

like image 540
Ivan S Avatar asked Jan 29 '14 17:01

Ivan S


1 Answers

Figured it out, Repeat Interval is essentially what I needed along with duration

Below is how to schedule something to run at 7:00 every day every 1 hour for a duration of 1 day.

schtasks /create /tn "test" /tr "\"test.exe"" /sc DAILY /st 07:00 /f /RI 60 /du 24:00
like image 187
Ivan S Avatar answered Sep 22 '22 19:09

Ivan S