Posted by & filed under Windows / Server.

I put together some information on creating scheduled tasks in Windows. This will actually be very useful for Windows 2008 Core, which only has the command line (great for performance!) So it’s time brush up on your command line skills.

To create a scheduled task via the command line, the command takes the following form:

schtasks /create /tn TASKNAME /tr TASKTORUN /sc SCHEDULETYPE /OPTIONIALMODIFIER

SCHEDULETYPE is anyone of the following, /mo being the optional modifier with the numbers beside it being the range that is acceptable. For multiple values behind the optional modifier, use a comma separated list:

minute: (minute /mo 1-1439) # of minutes between tasks
hourly: (hourly /mo 1-23) # of hours between tasks
daily: (daily /mo 1-365) # of days between tasks
weekly: (weekly /mo 1-52 /d MON,TUE,WED,THU,FRI,SAT,SUN) # of weeks between tasks, start on certain day
monthly: (monthly /mo 1-12 /d 1-31) # of months between tasks, start on certain day
monthly: (monthly /mo LASTDAY) # Start task on last day of each month
ONCE: Runs once at certain date and time, MM/DD/YYYY HH:MM 24 hour format
ONSTART: Runs at start-up
ONLOGON: Runs at user logon
ONIDLE: (/i 1-999): Runs when computer is idle for a certain time period (in minutes)

Below are optional modifiers that can be used with the schedule types and optional modifiers listed above.

/s COMPUTERNAME: Specifies the computer name of the task to be run
/u USERACCOUNT: Specifies the user account of the task to be run
/p PASSWORD: Specifies the password of the user account of the task to be run
/st STARTTIME: (/st HH:MM): Specifies the start time of the task in 24 hour format
/et ENDTIME: (/et HH:MM): Specifies the end time of the task in 24 hour format
/du DURATION: (/du HHHH:MM): Windows 2003 only, Specifies duration of task
/sd STARTDATE: (/sd MM/DD/YYYY): Specifies the start date of the task
/ed ENDDATE: (/ed MM/DD/YYYY): Specifies the end date of the task
(No Ratings Yet)

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>