Create a scheduled task to run immediately and then hourly

3

1

I am using the schtasks command to create a scheduled task that I want to have run hourly, so I am using the parameter: /sc HOURLY

However I would also like that task to run immediately on creation as well.

So the desired timeline is: Create task and run immediately, then run hourly after that.

The scheduled task is going to be installed via a batch file and the task takes several minutes to run, so whatever causes the initial run can not be blocking on the batch file.

zadam

Posted 2014-02-27T00:20:20.823

Reputation: 315

Answers

4

After you create the task you would like to schedule, run the following command:

schtasks /run /tn <name_of_task>

Where <name_of_task> is the name you gave to your scheduled task. Tested as working under Windows 7 Professional 32-bit.

JSanchez

Posted 2014-02-27T00:20:20.823

Reputation: 1 582