Windows – Create a scheduled task to run immediately and then hourly

scheduled-taskswindows

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.

Best Answer

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.

Related Question