Schtasks – create task with no schedule that runs on demand

scheduled-taskwindows-server-2008

I am trying to use schtasks.exe and create a one-time task that runs on demand. I just want to create the task without a schedule but the command schtasks /create /tn TestTask fails with Invalid syntax. Mandatory option 'sc' is missing.. Is there an option i am missing ?

Best Answer

Create the task and set it to start ONCE in the past. The task will exist and you can run it at will.