O'Reilly logo

Windows Server 2003 in a Nutshell by Mitch Tulloch

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Name

schtasks — new in WS2003

Synopsis

Schedules tasks (commands or programs) to run on a computer at a specified time/date and manages scheduled tasks.

Note

In WS2003, the schtasks command replaces the at command for managing and scheduling tasks from the command line (the at command remains only for backward compatibility with W2K/NT).

Syntax

General syntax:

schtasks /command 
                     switches [/s Computer [/u [Domain\]User [/p Password]]]

Syntax for each type of command:

schtasks /create /sc ScheduleType /tn TaskName /tr TaskRun 
  [/ru {[ Domain \] User | SYSTEM}] [/rp Password] 
  [/mo Modifier] [/d Day[,Day...] | *] [/m Month[,Month...]] 
  [/i IdleTime] [/st StartTime] [/ri Interval] [{/et EndTime 
      | /du Duration}   [/k]] 
  [/sd StartDate] [/ed EndDate] [/it] [/z] [/f] 
   
schtasks /change /tn TaskName   [/ru {[ Domain \] User | SYSTEM}]
  [/rp Password] [/tr TaskRun] [/st StartTime] [/ri Interval] 
  [{/et EndTime | 
/du Duration} [/k]] 
  [/sd StartDate] [/ed EndDate] [/{ENABLE | DISABLE}] [/it] [/z] 
   
schtasks /run /tn TaskName 
   
schtasks /end /tn TaskName 
   
schtasks /delete /tn { TaskName | *} [/f]
   
schtasks [/query] [/fo {TABLE | LIST | CSV}] [/nh] [/v]

Options

Here are the commands for schtasks:

create

Creates a scheduled task

change

Modifies properties of a scheduled task

run

Runs a scheduled task immediately

end

Stops a running task

delete

Deletes a scheduled task

query

Displays all scheduled tasks (can omit /query)

The remaining switches for schtasks are:

/sc ScheduleType

Type of schedule, choose from:

MINUTE
HOURLY
DAILY
WEEKLY
MONTHLY ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required