text
stringlengths
0
4.23k
/st <Starttime>
Specifies the start time for the task, using the 24-hour time format, HH:mm. The default value is the current time on the local computer. The /st parameter is valid with MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, and ONCE schedules. It's required for a ONCE schedule.
/ri <interval>
Specifies the repetition interval for the scheduled task, in minutes. This isn't applicable for schedule types: MINUTE, HOURLY, ONSTART, ONLOGON, and ONIDLE. Valid range is 1 - 599940 (599940 minutes = 9999 hours). If either the /et or /du parameters are specified, the default is 10 minutes.
/rl <level>
Specifies the Run Level for the job. Acceptable values are LIMITED (scheduled tasks will be ran with the least level of privileges, such as Standard User accounts) and HIGHEST (scheduled tasks will be ran with the highest level of privileges, such as Superuser accounts). (Note: LIMITED is the default value).
/et <Endtime>
Specifies the time of day that a minute or hourly task schedule ends in <HH:MM> 24-hour format. After the specified end time, schtasks does not start the task again until the start time recurs. By default, task schedules have no end time. This parameter is optional and valid only with a MINUTE or HOURLY schedule.
/du <duration>
Specifies a maximum length of time for a minute or hourly schedule in <HHHH:MM> 24-hour format. After the specified time elapses, schtasks does not start the task again until the start time recurs. By default, task schedules have no maximum duration. This parameter is optional and valid only with a MINUTE or HOURLY schedule.
/k
Stops the program that the task runs at the time specified by /et or /du. Without /k, schtasks doesn't start the program again after it reaches the time specified by /et or /du nor does it stop the program if it's still running. This parameter is optional and valid only with a MINUTE or HOURLY schedule.
/sd <Startdate>
Specifies the date on which the task schedule starts. The default value is the current date on the local computer. The format for Startdate varies with the locale selected for the local computer in Regional and Language Options. Only one format is valid for each locale. The valid date formats include (be sure to choose the format most similar to the format selected for Short date in Regional and Language Options on the local computer):<MM>// - Specifies to use month-first formats, such as English (United States) and Spanish (Panama).<DD>// - Specifies to use day-first formats, such as Bulgarian and Dutch (Netherlands).<YYYY>// - Specifies to use for year-first formats, such as Swedish and French (Canada).
/ed <Enddate>
Specifies the date on which the schedule ends. This parameter is optional. It isn't valid in a ONCE, ONSTART, ONLOGON, or ONIDLE schedule. By default, schedules have no ending date. The default value is the current date on the local computer. The format for Enddate varies with the locale selected for the local computer in Regional and Language Options. Only one format is valid for each locale. The valid date formats include (be sure to choose the format most similar to the format selected for Short date in Regional and Language Options on the local computer):<MM>// - Specifies to use month-first formats, such as English (United States) and Spanish (Panama).<DD>// - Specifies to use day-first formats, such as Bulgarian and Dutch (Netherlands).<YYYY>// - Specifies to use for year-first formats, such as Swedish and French (Canada).
/it
Specifies to run the scheduled task only when the run as user (the user account under which the task runs) is logged on to the computer. This parameter has no effect on tasks that run with system permissions or tasks that already have the interactive-only property set. You can't use a change command to remove the interactive-only property from a task. By default, run as user is the current user of the local computer when the task is scheduled or the account specified by the /u parameter, if one is used. However, if the command includes the /ru parameter, then the run as user is the account specified by the /ru parameter.
/np
No password is stored. The task runs non-interactively as the given user. Only local resources are available.
/z
Specifies to delete the task upon the completion of its schedule.
/f
Specifies to create the task and suppress warnings if the specified task already exists.
/?
Displays help at the command prompt.
<scheduletype>
<taskname>
<folder name\task name>
<Taskrun>
<systemroot>\System32
<computer>
[<domain>]
<password>
<domain>
<user>
system}
<password>
<modifiers>
/d <day>
NOTE: The date value of 1 - 31 is valid only without the /mo parameter, or if the /mo parameter is monthly (1 - 12). The default is day 1 (the first day of the month).
*
*
<Idletime>
<Starttime>
<interval>
<level>
<Endtime>
<duration>
<Startdate>
<MM>//
<DD>//
<YYYY>//
<Enddate>
<MM>//
<DD>//
<YYYY>//
To schedule a task to run every <n> minutes
<n>
In a minute schedule, the /sc minute parameter is required. The /mo (modifier) parameter is optional and specifies the number of minutes between each run of the task. The default value for /mo is 1 (every minute). The /et (end time) and /du (duration) parameters are optional and can be used with or without the /k (end task) parameter.
Examples
To schedule a security script, Sec.vbs, to run every 20 minutes, type:
schtasks /create /sc minute /mo 20 /tn "Security Script" /tr \\central\data\scripts\sec.vbs
Because this example doesn't include a starting date or time, the task starts 20 minutes after the command completes, and runs every 20 minutes thereafter whenever the system is running. Notice that the security script source file is located on a remote computer, but that the task is scheduled and executes on the local computer.
To schedule a security script, Sec.vbs, to run on the local computer every 100 minutes between 5:00 P.M. and 7:59 A.M. each day, type:
schtasks /create /tn "Security Script" /tr sec.vbs /sc minute /mo 100 /st 17:00 /et 08:00 /k
This example uses the /sc parameter to specify a minute schedule and the /mo parameter to specify an interval of 100 minutes. It uses the /st and /et parameters to specify the start time and end time of each day's schedule. It also uses the /k parameter to stop the script if it's still running at 7:59 A.M. Without /k, schtasks wouldn't start the script after 7:59 A.M., but if the instance started at 6:20 A.M. was still running, it wouldn't stop it.
To schedule a task to run every <n> hours
<n>
In an hourly schedule, the /sc hourly parameter is required. The /mo (modifier) parameter is optional and specifies the number of hours between each run of the task. The default value for /mo is 1 (every hour). The /k (end task) parameter is optional and can be used with either /et (end at the specified time) or /du (end after the specified interval).