schtasks
Windows CMD · System · reference only
What it does
Creates, queries, runs and deletes scheduled tasks from the command line.
Syntax
schtasks /create|/query|/run|/delete|/change [opciones]
Options and parameters
/queryLists the scheduled tasks.
/createCreates a new task.
/runRuns a task now, without waiting for its time.
/deleteDeletes a task; add /f to skip the confirmation.
/tn nombreTask name.
/tr programaProgram or script the task runs.
/sc frecuenciaFrequency: minute, hourly, daily, weekly, monthly, once, onlogon, onstart.
/st hh:mmTask start time.
Usage examples
schtasks /queryLists all the machine's scheduled tasks.
schtasks /create /tn Copia /tr C:\scripts\backup.bat /sc daily /st 02:00Schedules a daily backup at 2:00.
schtasks /run /tn CopiaRuns the Copia task immediately.
schtasks /delete /tn Copia /fDeletes the task without asking for confirmation.
Notes and common mistakes
- To create tasks that run as another user or with privileges you need an administrator console.
- The time format is 24-hour.