20

I created a task in Windows 7 task scheduler.

How do I run it using the command prompt?

Kev
  • 118,037
  • 53
  • 300
  • 385
Kodak
  • 1,779
  • 2
  • 18
  • 29

1 Answers1

33

The syntax is: schtasks /Run /TN "task name"

For more information see:

Run a Task on Demand (MS TechNet)

Kev
  • 118,037
  • 53
  • 300
  • 385
Kodak
  • 1,779
  • 2
  • 18
  • 29
  • What if task doesn't have `Allow task to be run on demand` enabled? It gives an error. How to enable run on demand? – ST3 Jul 07 '15 at 11:52
  • 1
    How about opening the task and tick/enable run on demand in setting? Do you ask how to do it programmatically? You would need to find an API for that. Task parameters are stored in registry (at least in Windows 7, under HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Schedule\TaskCache\Tasks) but it is stored in a form of a hash so it is not that easy to update – Kodak Jul 08 '15 at 06:50