Schtasks.exeSchtasks.exe

使管理员能够在本地或远程计算机上创建、删除、查询、更改、运行和结束计划任务。Enables an administrator to create, delete, query, change, run, and end scheduled tasks on a local or remote computer. 运行不带参数的 Schtasks.exe 将显示每个已注册任务的状态和下次运行时间。Running Schtasks.exe without arguments displays the status and next run time for each registered task.

有关任务计划程序的详细信息,请参阅本简介: 开发人员任务计划程序For more information on Task Scheduler, see this introduction: Task Scheduler for developers.

创建任务Creating a Task

以下语法用于在本地或远程计算机上创建任务。The following syntax is used to create a task on the local or remote computer.

schtasks /Create 
[/S system [/U username [/P [password]]]]
[/RU username [/RP [password]] /SC schedule [/MO modifier] [/D day]
[/M months] [/I idletime] /TN taskname /TR taskrun [/ST starttime]
[/RI interval] [ {/ET endtime | /DU duration} [/K] 
[/XML xmlfile] [/V1]] [/SD startdate] [/ED enddate] [/IT] [/Z] [/F]

参数Parameters

/S 系统/S system

一个值,该值指定要连接到的远程计算机。A value that specifies the remote computer to connect to. 如果省略,则系统参数默认为本地计算机。If omitted, the system parameter defaults to the local computer.

/U 用户名/U username

一个值,该值指定 Schtasks.exe 应在其下运行的用户上下文。A value that specifies the user context under which Schtasks.exe should run.

/P [ 密码 ]/P [password]

一个值,该值指定给定用户上下文的密码。A value that specifies the password for a given user context. 如果省略,Schtasks.exe 会提示用户输入。If omitted, Schtasks.exe prompts the user for input.

/Ru 用户名/RU username

一个值,该值指定运行任务的用户上下文。A value that specifies the user context under which the task runs. 对于系统帐户,有效值为 ""、"NT 核证机关 \ system" 或 "system"。For the system account, valid values are "", "NT AUTHORITY\SYSTEM", or "SYSTEM". 对于任务计划程序2.0 任务,"NT 核证 \ LOCALSERVICE" 和 "NT 机关 \ NETWORKSERVICE" 也是有效值。For Task Scheduler 2.0 tasks, "NT AUTHORITY\LOCALSERVICE", and "NT AUTHORITY\NETWORKSERVICE" are also valid values.

/Rp [ 密码 ]/RP [password]

一个值,该值指定使用/RU 参数指定的用户的密码。A value that specifies the password for the user specified with the /RU parameter. 若要提示输入密码,则该值必须是 " * " 或 "无" 值。To prompt for the password, the value must be either "*" or no value. 对于系统帐户,此密码将被忽略。This password is ignored for the system account. 此参数必须与/RU 或/XML 开关组合在一起。This parameter must be combined with either /RU or the /XML switch.

/SC 计划/SC schedule

一个指定计划频率的值。A value that specifies the schedule frequency. 有效值为: MINUTE、每小时、每日、每周、每月、一次、ONLOGON、ONIDLE 和 ONEVENT。Valid values are: MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE, ONLOGON, ONIDLE, and ONEVENT.

/Mo 修饰符/MO modifier

用于精炼计划类型以允许更好地控制计划重复的值。A value that refines the schedule type to allow for finer control over the schedule recurrence. 有效值是:Valid values are:

  • 分钟: 1-1439 分钟。MINUTE: 1 - 1439 minutes.
  • 每小时: 1-23 小时。HOURLY: 1 - 23 hours.
  • 每天: 1-365 天。DAILY: 1 - 365 days.
  • 每周:周 1-52。WEEKLY: weeks 1 - 52.
  • 一次:没有修饰符。ONCE: No modifiers.
  • ONSTART: No 修饰符。ONSTART: No modifiers.
  • ONLOGON:没有修饰符。ONLOGON: No modifiers.
  • ONIDLE: No 修饰符。ONIDLE: No modifiers.
  • 每月: 1-12,或者第一、第二、第三、第四、最后和 LASTDAY。MONTHLY: 1 - 12, or FIRST, SECOND, THIRD, FOURTH, LAST, and LASTDAY.
  • ONEVENT: XPath 事件查询字符串。ONEVENT: XPath event query string.

/D /D days

一个值,该值指定运行任务的日期(星期几)。A value that specifies the day of the week to run the task. 有效值为:周一至,周二,周三,THU,星期五,周六,周日,每月计划 1-31 (天) 。Valid values are: MON, TUE, WED, THU, FRI, SAT, SUN and for MONTHLY schedules 1 - 31 (days of the month). 通配符 (*) 指定所有日期。The wildcard character (*) specifies all days.

/M 个月/M months

一个值,该值指定年份中的月份。A value that specifies months of the year. 默认为每月的第一天。Defaults to the first day of the month. 有效值为: JAN、二月、三月、APR、六月、六月、七月、8月、09月、十月、11月和十二月。Valid values are: JAN, FEB, MAR, APR, MAY, JUN, JUL, AUG, SEP, OCT, NOV, and DEC. 通配符 (*) 指定所有月份。The wildcard character (*) specifies all months.

/I idletime/I idletime

一个值,该值指定在运行计划的 ONIDLE 任务之前要等待的空闲时间量。A value that specifies the amount of idle time to wait before running a scheduled ONIDLE task. 有效范围为 1-999 分钟。The valid range is 1 - 999 minutes.

/Tn taskname/TN taskname

一个值,该值指定唯一标识计划任务的名称。A value that specifies a name which uniquely identifies the scheduled task.

/Tr k/TR taskrun

一个值,该值指定要在计划时间运行的任务的路径和文件名。A value that specifies the path and file name of the task to be run at the scheduled time. 例如: C: \ Windows \ System32 \calc.exe。For example: C:\Windows\System32\calc.exe.

/St starttime/ST starttime

一个值,该值指定运行任务的开始时间。A value that specifies the start time to run the task. 时间格式为 HH: mm (24 小时制) 。The time format is HH:mm (24-hour time). 例如,14:30 指定2:下午6:30。For example, 14:30 specifies 2:30PM. 默认值为未指定/ST 的当前时间。The default is the current time is /ST is not specified. 此选项是/SC 一次参数所必需的。This option is required wit the /SC ONCE argument.

/RI 间隔/RI interval

一个值,该值指定重复间隔(分钟)。A value that specifies the repetition interval in minutes. 这不适用于以下计划类型:分钟、小时、ONSTART、ONLOGON、ONIDLE 和 ONEVENT。This is not applicable for the following schedule types: MINUTE, HOURLY, ONSTART, ONLOGON, ONIDLE, and ONEVENT. 有效范围为 1-599940 分钟。The valid range is 1 - 599940 minutes. 如果指定/ET 或/DU 参数,则默认值为10分钟。If either the /ET or /DU parameters are specified, the default is 10 minutes.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/Et endtime/ET endtime

一个值,该值指定运行任务的结束时间。A value that specifies the end time to run the task. 时间格式为 HH: mm (24 小时制) 。The time format is HH:mm (24-hour time). 例如,14:50 指定2:50PM。For example, 14:50 specifies 2:50PM. 这不适用于以下计划类型: ONSTART、ONLOGON、ONIDLE 和 ONEVENT。This is not applicable for the following schedule types: ONSTART, ONLOGON, ONIDLE, and ONEVENT.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/Du duration/DU duration

一个值,该值指定运行任务的持续时间。A value that specifies the duration to run the task. 时间格式为 HH: mm (24 小时制) 。The time format is HH:mm (24-hour time). 例如,14:50 指定2:50PM。For example, 14:50 specifies 2:50PM. 这不适用于/ET 和以下计划类型: ONSTART、ONLOGON、ONIDLE 和 ONEVENT。This is not applicable with /ET and for the following schedule types: ONSTART, ONLOGON, ONIDLE, and ONEVENT. 对于/V1 任务 (任务计划程序1.0 任务) ,如果指定了/RI,则持续时间默认为1小时。For /V1 tasks (Task Scheduler 1.0 tasks), if /RI is specified, then the duration default is one hour.

WINDOWS XP: 此选项不可用。Windows XP: This option is not available.

遇到/K

一个值,该值在结束时间或持续时间终止任务。A value that terminates the task at the end time or duration time. 这不适用于以下计划类型: ONSTART、ONLOGON、ONIDLE 和 ONEVENT。This is not applicable for the following schedule types: ONSTART, ONLOGON, ONIDLE, and ONEVENT. 必须指定/ET 或/DU。Either /ET or /DU must be specified.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/Sd 开始/SD startdate

一个值,该值指定要在其上运行任务的第一个日期。A value that specifies the first date on which to run the task. 格式为 mm/dd/yyyy。The format is mm/dd/yyyy. 此值默认为当前日期。This value defaults to the current date. 这不适用于以下计划类型:一次、ONSTART、ONLOGON、ONIDLE 和 ONEVENT。This is not applicable for the following schedule types: ONCE, ONSTART, ONLOGON, ONIDLE, and ONEVENT.

/ED 结束 日期/ED enddate

一个值,该值指定任务将运行的最后日期。A value that specifies the last date that the task will run. 格式为 mm/dd/yyyy。The format is mm/dd/yyyy. 这不适用于以下计划类型:一次、ONSTART、ONLOGON、ONIDLE 和 ONEVENT。This is not applicable for the following schedule types: ONCE, ONSTART, ONLOGON, ONIDLE, and ONEVENT.

/EC ChannelName/EC ChannelName

一个值,该值指定 ONEVENT 触发器的事件通道。A value that specifies the event channel for ONEVENT triggers.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/IT/IT

此值使任务仅在/RU 用户当前在任务运行时登录时才以交互方式运行。A value that enables the task to run interactively only if the /RU user is currently logged on at the time the task runs. 仅当用户登录时,任务才运行。The task runs only if the user is logged on.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/NP/NP

一个值,该值指示未存储任何密码。A value that indicates that no password is stored. 该任务不会以交互方式与给定用户一起运行。The task does not run interactively as the given user. 仅本地资源可用。Only local resources are available.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/Z/Z

一个值,用于将任务标记为在其最终运行后被删除。A value that marks the task to be deleted after its final run.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/Xml xmlfile/XML xmlfile

从 XML 文件创建任务的值。A value that creates a task from an XML file. 此参数可以与/RU 和/RP 开关结合,或在任务 XML 已包含主体时单独与/RP 开关一起结合。This parameter can be combined with /RU and /RP switches, or with the /RP switch alone when the task XML already contains the principal.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/V1/V1

用于创建对 Windows 2000、Windows Server 2003 和 Windows XP 平台可见的任务的值。A value that creates a task visible to Windows 2000, Windows Server 2003, and Windows XP platforms.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/F/F

一个强制创建任务的值,如果指定的任务已存在,则禁止显示警告。A value that forcefully creates the task and suppresses warnings if the specified task already exists.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/RL 级别/RL level

设置任务运行级别的值。A value that sets the run level for the task. 有效值为 "有限" 和 "最高"。Valid values are LIMITED and HIGHEST. 默认值为 "受限"。The default is LIMITED.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/DELAY delaytime/DELAY delaytime

一个值,该值指定触发触发器后延迟任务的等待时间。A value that specifies the wait time to delay the task after the trigger is fired. 时间格式为 mmmm: ss。The time format is mmmm:ss. 此选项仅对计划类型 ONSTART、ONLOGON 和 ONEVENT 有效。This option is only valid for schedule types ONSTART, ONLOGON, and ONEVENT.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/?/?

显示 Schtasks.exe 的帮助消息的值。A value that displays the help message for Schtasks.exe.

注解Remarks

在运行 Windows XP、Windows Server 2003 或 Windows 2000 操作系统的远程计算机上创建任务时,请使用/V1 开关。When creating a task on a remote computer running on the Windows XP, Windows Server 2003, or Windows 2000 operating system, use the /V1 switch.

如果远程计算机启用了 "文件和打印机共享" 防火墙例外并且禁用了 "远程计划任务管理" 防火墙例外,则不能创建非交互式远程任务计划程序1.0 任务 (使用/IT 开关创建任务,并使用/V1 开关) 。You cannot create a non-interactive remote Task Scheduler 1.0 task (create a task by not using the /IT switch and using the /V1 switch) if the remote computer has the File and Printer Sharing firewall exception enabled and the Remote Scheduled Tasks Management firewall exception disabled.

删除任务Deleting a Task

使用以下语法可删除一个或多个计划任务。The following syntax is used to delete one or more scheduled tasks.

schtasks /Delete 
[/S system [/U username [/P [password]]]]
[/TN taskname] [/F]

参数Parameters

/S 系统/S system

一个值,该值指定要连接到的远程计算机。A value that specifies the remote computer to connect to. 如果省略,则系统参数默认为本地计算机。If omitted, the system parameter defaults to the local computer.

/U 用户名/U username

一个值,该值指定 Schtasks.exe 应在其下运行的用户上下文。A value that specifies the user context under which Schtasks.exe should run.

/P [ 密码 ]/P [password]

一个值,该值指定给定用户上下文的密码。A value that specifies the password for the given user context. 如果省略,Schtasks.exe 会提示用户输入。If omitted, Schtasks.exe prompts the user for input.

/Tn taskname/TN taskname

一个值,该值指定要删除的计划任务的名称。A value that specifies the name of the scheduled task to delete. 通配符 (*) 可用于删除所有任务。The wildcard character (*) can be used to delete all tasks.

/F/F

一个强制删除任务并在指定任务正在运行时禁止显示警告的值。A value that forcefully deletes the task and suppresses warnings if the specified task is running.

/?/?

显示 Schtasks.exe 的帮助的值。A value that displays Help for Schtasks.exe.

运行任务Running a Task

下面的语法用于立即运行计划的任务。The following syntax is used to immediately run a scheduled task.

schtasks /Run 
[/S system [/U username [/P [password]]]]
/TN taskname

参数Parameters

/S 系统/S system

一个值,该值指定要连接到的远程计算机。A value that specifies the remote computer to connect to. 如果省略,则系统参数默认为本地计算机。If omitted, the system parameter defaults to the local computer.

/U 用户名/U username

一个值,该值指定 Schtasks.exe 应在其下运行的用户上下文。A value that specifies the user context under which Schtasks.exe should run.

/P [ 密码 ]/P [password]

一个值,该值指定给定用户上下文的密码。A value that specifies the password for the given user context. 如果省略,Schtasks.exe 会提示用户输入。If omitted, Schtasks.exe prompts the user for input.

/Tn taskname/TN taskname

一个值,该值指定要运行的计划任务的名称。A value that specifies the name of the scheduled task to run.

/?/?

显示 Schtasks.exe 的帮助的值。A value that displays Help for Schtasks.exe.

结束正在运行的任务Ending a Running Task

下面的语法用于停止正在运行的计划任务。The following syntax is used to stop a running scheduled task.

备注

若要停止远程任务运行,请确保远程计算机已启用 "文件和打印机共享" 和 "远程计划任务管理" 防火墙例外。To stop a remote task from running, ensure that the remote computer has the File and Printer Sharing and Remote Scheduled Tasks Management firewall exceptions enabled.

schtasks /End 
[/S system [/U username [/P [password]]]]
/TN taskname

参数Parameters

/S 系统/S system

一个值,该值指定要连接到的远程计算机。A value that specifies the remote computer to connect to. 如果省略,则系统参数默认为本地计算机。If omitted, the system parameter defaults to the local computer.

/U 用户名/U username

一个值,该值指定 Schtasks.exe 应在其下运行的用户上下文。A value that specifies the user context under which Schtasks.exe should run.

/P [ 密码 ]/P [password]

一个值,该值指定给定用户上下文的密码。A value that specifies the password for the given user context. 如果省略,Schtasks.exe 会提示用户输入。If omitted, Schtasks.exe prompts the user for input.

/Tn taskname/TN taskname

一个值,该值指定要停止的计划任务的名称。A value that specifies the name of the scheduled task to stop.

/?/?

显示 Schtasks.exe 的帮助的值。A value that displays Help for Schtasks.exe.

查询任务信息Querying for Task Information

以下语法用于显示本地或远程计算机上的计划任务。The following syntax is used to display the scheduled tasks from the local or remote computer.

schtasks /Query 
[/S system [/U username [/P [password]]]]
[/FO format | /XML] [/NH] [/V] [/TN taskname] [/?]

参数Parameters

/S 系统/S system

一个值,该值指定要连接到的远程计算机。A value that specifies the remote computer to connect to. 如果省略,则系统参数默认为本地计算机。If omitted, the system parameter defaults to the local computer.

/U 用户名/U username

一个值,该值指定 Schtasks.exe 应在其下运行的用户上下文。A value that specifies the user context under which Schtasks.exe should run.

/P [ 密码 ]/P [password]

一个值,该值指定给定用户上下文的密码。A value that specifies the password for the given user context. 如果省略,Schtasks.exe 会提示用户输入。If omitted, Schtasks.exe prompts the user for input.

/Fo 格式/FO format

一个值,该值指定输出格式。A value that specifies the output format. 有效值为 "表"、"列表" 和 "CSV"。The valid values are TABLE, LIST, and CSV.

/NH/NH

一个值,该值指定列标题不应显示在输出中。A value that specifies that the column header should not be displayed in the output. 这仅对表和 CSV 格式有效。This is valid only for TABLE and CSV formats.

/V/V

显示详细任务输出的值。A value that displays verbose task output.

备注

如果任务计划只运行一次,则显示的计划信息为 "计划数据不可用此格式"。If a task was scheduled to run only one time, then the displayed schedule information is "Scheduling data is not available in this format."

/Tn taskname/TN taskname

一个值,该值指定要为其检索信息的任务名称。A value that specifies the task name for which to retrieve the information. 如果未指定任务名称,将显示所有任务的信息。If no task name is specified, then information for all the tasks will be displayed.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/XML/XML

用于显示 XML 格式的任务定义的值。A value that is used to display the task definitions in XML format.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/?/?

用于显示 Schtasks.exe 的帮助的值。A value that is used to display the Help for Schtasks.exe.

更改任务Changing a Task

下面的语法用于更改程序运行的方式,或更改计划任务使用的用户帐户和密码。The following syntax is used to change how the program runs, or change the user account and password used by a scheduled task.

schtasks /Change 
[/S system [/U username [/P [password]]]] /TN taskname
{ [/RU runasuser] [/RP runaspassword] [/TR taskrun] [/ST starttime] 
[/RI interval] [ {/ET endtime | /DU duration} [/K] ]
[/SD startdate] [/ED enddate] [/ENABLE | /DISABLE] [/IT] [/Z] }

参数Parameters

/S 系统/S system

一个值,该值指定要连接到的远程计算机。A value that specifies the remote computer to connect to. 如果省略,则系统参数默认为本地计算机。If omitted, the system parameter defaults to the local computer.

/U 用户名/U username

一个值,该值指定 Schtasks.exe 应在其下运行的用户上下文。A value that specifies the user context under which Schtasks.exe should run.

/P [ 密码 ]/P [password]

一个值,该值指定给定用户上下文的密码。A value that specifies the password for the given user context. 如果省略,Schtasks.exe 会提示用户输入。If omitted, Schtasks.exe prompts the user for input.

/Tn taskname/TN taskname

一个值,该值指定要更改的计划任务。A value that specifies which scheduled task to change.

/Ru runasuser/RU runasuser

一个值,该值更改将运行计划任务) (用户上下文的用户名。A value that changes the user name (user context) under which the scheduled task will run. 对于系统帐户,有效值为 ""、"NT 核证机关 \ system" 或 "system"。For the system account, valid values are "", "NT AUTHORITY\SYSTEM", or "SYSTEM". 对于任务计划程序2.0 任务,"NT 机关 \ LOCALSERVICE" 和 "NT 机关 \ NETWORKSERVICE" 也是有效值。For Task Scheduler 2.0 tasks, "NT AUTHORITY\LOCALSERVICE" and "NT AUTHORITY\NETWORKSERVICE" are also valid values.

/Rp runaspassword/RP runaspassword

一个值,该值指定现有用户上下文的新密码或新用户帐户的密码。A value that specifies a new password for the existing user context or the password for a new user account. 对于系统帐户,此密码将被忽略。This password is ignored for the system account.

/Tr k/TR taskrun

一个值,该值指定任务将运行的新程序。A value that specifies a new program that the task will run.

/St starttime/ST starttime

一个值,该值指定运行任务的开始时间。A value that specifies the start time to run the task. 时间格式为 HH: mm (24 小时制) 。The time format is HH:mm (24-hour time). 例如,14:30 指定2:下午6:30。For example, 14:30 specifies 2:30PM.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/RI 间隔/RI interval

一个值,该值指定重复间隔,以分钟为单位。A value that specifies the repetition interval, in minutes. 有效范围为 1-599940 分钟。The valid range is 1 - 599940 minutes.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/Et endtime/ET endtime

一个值,该值指定任务的结束时间。A value that specifies the end time for the task. 时间格式为 HH: mm (24 小时制) 。The time format is HH:mm (24-hour time). 例如,14:50 指定2:50PM。For example, 14:50 specifies 2:50PM.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/Du duration/DU duration

一个值,该值指定运行任务的持续时间。A value that specifies the duration to run the task. 时间格式为 HH: mm (24 小时制) 。The time format is HH:mm (24-hour time). 例如,14:50 指定2:50PM。For example, 14:50 specifies 2:50PM. 这不适用于/ET 参数。This is not applicable with the /ET parameter.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

遇到/K

一个值,该值在结束时间或持续时间终止任务。A value that terminates the task at the end time or duration time.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/Sd 开始/SD startdate

一个值,该值指定要在其上运行任务的第一个日期。A value that specifies the first date on which to run the task. 格式为 mm/dd/yyyy。The format is mm/dd/yyyy.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/ED 结束 日期/ED enddate

一个值,该值指定任务将运行的最后日期。A value that specifies the last date that the task will run. 格式为 mm/dd/yyyy。The format is mm/dd/yyyy.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/IT/IT

此值使任务仅在/RU 用户当前在任务运行时登录时才以交互方式运行。A value that enables the task to run interactively only if the /RU user is currently logged on at the time the task runs. 仅当用户登录时,任务才运行。The task runs only if the user is logged on.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/RL 级别/RL level

设置任务运行级别的值。A value that sets the run level for the task. 有效值为 "有限" 和 "最高"。Valid values are LIMITED and HIGHEST.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/ENABLE/ENABLE

启用计划任务的值。A value that enables the scheduled task. 已启用的任务可以运行,并且禁用的任务不能运行。An enabled task can run, and a disabled task cannot run.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/DISABLE/DISABLE

用于禁止计划任务运行的值。A value that disables the scheduled task from running.

备注

如果远程任务计划程序1.0 任务禁用了 Schtasks.exe 并且远程计算机启用了 "文件和打印机共享" 防火墙例外,并且禁用了 "远程计划任务管理" 防火墙例外,则从任务计划程序 2.0 API 读取任务时将不会禁用该任务。If a remote Task Scheduler 1.0 task is disabled by Schtasks.exe and the remote computer has the File and Printer Sharing firewall exception enabled and the Remote Scheduled Tasks Management firewall exception disabled, then the task will not be disabled when read from a Task Scheduler 2.0 API.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/Z/Z

一个值,用于将任务标记为在其最终运行后被删除。A value that marks the task to be deleted after its final run.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/DELAY delaytime/DELAY delaytime

一个值,该值指定触发触发器后延迟任务运行的等待时间。A value that specifies the wait time to delay the running of the task after the trigger is fired. 时间格式为 mmmm: ss。The time format is mmmm:ss. 此选项仅对计划类型为 ONSTART、ONLOGON 和 ONEVENT 的任务有效。This option is only valid for tasks with the schedule types ONSTART, ONLOGON, and ONEVENT.

WINDOWS XP 和 Windows Server 2003: 此选项不可用。Windows XP and Windows Server 2003: This option is not available.

/?/?

显示 Schtasks.exe 的帮助消息的值。A value that displays the Help message for Schtasks.exe.

要求Requirements

要求Requirement Value
最低受支持的客户端Minimum supported client
[仅限 WINDOWS XP 桌面应用]Windows XP [desktop apps only]
最低受支持的服务器Minimum supported server
仅限 Windows Server 2003 [ 桌面应用]Windows Server 2003 [desktop apps only]