text stringlengths 0 4.23k |
|---|
<format> |
<computer> |
[<domain>] |
<password> |
Examples |
To list all tasks scheduled for the local computer,type: |
schtasks |
schtasks /query |
These commands produce the same result and can be used interchangeably. |
To request a detailed display of the tasks on the local computer,type: |
schtasks /query /fo LIST /v |
This command uses the /v parameter to request a detailed (verbose) display and the /fo LIST parameter to format the display as a list for easy reading. You can use this command to verify that a task you created has the intended recurrence pattern. |
To request a list of tasks scheduled for a remote computer and to add the tasks to a comma-separated log file on the local computer, type: |
schtasks /query /s Reskit16 /fo csv /nh >> \\svr01\data\tasklogs\p0102.csv |
You can use this command format to collect and track tasks that are scheduled for multiple computers. This command uses the /s parameter to identify the remote computer, Reskit16, the /fo parameter to specify the format and the /nh parameter to suppress the column headings. The >> append symbol redirects the output to the task log, p0102.csv, on the local computer, Svr01. Because the command runs on the remote computer, the local computer path must be fully qualified. |
schtasks run |
Starts a scheduled task immediately. The run operation ignores the schedule, but uses the program file location, user account, and password saved in the task to run the task immediately. Running a task does not affect the task schedule and does not change the next run time scheduled for the task. |
Syntax |
schtasks /run /tn <taskname> [/s <computer> [/u [<domain>\]<user> [/p <password>]]] |
Parameters |
Parameter |
Description |
/tn <taskname> |
Identifies the task to start. This parameter is required. |
/s <computer> |
Specifies the name or IP address of a remote computer (with or without backslashes). The default is the local computer. |
/u [<domain>] |
Runs this command with the permissions of the specified user account. By default, the command runs with the permissions of the current user of the local computer. The specified user account must be a member of the Administrators group on the remote computer. The /u and /p parameters are valid only when you use /s. |
/p <password> |
Specifies the password of the user account specified in the /u parameter. If you use the /u parameter without the /p parameter or the password argument, schtasks will prompt you for a password. The /u and /p parameters are valid only when you use /s. |
/? |
Displays help at the command prompt. |
<taskname> |
<computer> |
[<domain>] |
<password> |
Remarks |
Use this operation to test your tasks. If a task doesn't run, check the Task Scheduler Service transaction log, <Systemroot>\SchedLgU.txt for errors. |
<Systemroot>\SchedLgU.txt |
To run a task remotely, the task must be scheduled on the remote computer. When you run the task, it runs only on the remote computer. To verify that a task is running on a remote computer, use Task Manager or the Task Scheduler Service transaction log, <Systemroot>\SchedLgU.txt. |
<Systemroot>\SchedLgU.txt |
Examples |
To start the Security Script task, type: |
schtasks /run /tn Security Script |
To start the Update task on a remote computer, Svr01, type: |
schtasks /run /tn Update /s Svr01 |
schtasks commands |
Schedules commands and programs to run periodically or at a specific time, adds and removes tasks from the schedule, starts and stops tasks on demand, and displays and changes scheduled tasks. |
Note |
The schtasks.exe tool performs the same operations as Scheduled Tasks in Control Panel. You can use these tools together and interchangeably. |
Required permissions |
To schedule, view, and change all tasks on the local computer, you must be a member of the Administrators group. |
To schedule, view, and change all tasks on the remote computer, you must be a member of the Administrators group on the remote computer, or you must use the /u parameter to provide the credentials of an Administrator of the remote computer. |
You can use the /u parameter in a /create or /change operation if the local and remote computers are in the same domain, or if the local computer is in a domain that the remote computer domain trusts. Otherwise, the remote computer can't authenticate the user account specified, and it can't verify that the account is a member of the Administrators group. |
The task you plan to run must have the appropriate permission; these permissions vary by task. By default, tasks run with the permissions of the current user of the local computer, or with the permissions of the user specified by the /u parameter, if one is included. To run a task with permissions of a different user account or with system permissions, use the /ru parameter. |
Syntax |
schtasks /change |
schtasks /create |
schtasks /delete |
schtasks /end |
schtasks /query |
schtasks /run |
Parameters |
Parameter |
Description |
schtasks change |
Changes one or more of the following properties of a task:The program that the task runs (/tr)The user account under which the task runs (/ru)The password for the user account (/rp)Adds the interactive-only property to the task (/it) |
schtasks create |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.