Note The schtasks. Submit and view feedback for This product This page. View all page feedback. In this article. Starts a scheduled task immediately. Settings for intWindowStyle :. The active window remains active. Specify this flag when restoring a minimized window. In the Windows Task Scheduler the task properties include a tick box for "Hidden", this does not minify or hide the command window, but does hide the task from Task Scheduler's list of tasks.
The time format is HH:mm. The time format is HH:mm 24 hour time for example, for PM. Valid range: 1 — minutes. This task runs only if the user is logged in. Defaults to the first day of the month. The task runs non-interactively as the given user. Only local resources are available. Prompts for input if omitted.
This password is ignored for the system account. A valid value is a whole number from 1 to The default value is the current time on the local computer. It is required for a ONCE schedule. Specifies the repetition interval in minutes.
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. 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. Specifies the date on which the task schedule starts. The default value is the current date on the local computer.
Only one format is valid for each locale. The valid date formats are listed in the following table. Use the format most similar to the format selected for Short date in Regional and Language Options in Control Panel on the local computer. Use for day-first formats, such as Bulgarian and Dutch Netherlands.
Use for year-first formats, such as Swedish and French Canada. Specifies the date on which the schedule ends. This parameter is optional. By default, schedules have no ending date.
Specifies to run the 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. The following command schedules a security script, Sec.
Because the command does not 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. The following command schedules the MyApp program to run every five hours beginning on the first day of March Because the command does not specify a start time, the current time is used as the start time.
The following command schedules the MyApp program to run hourly beginning at five minutes past midnight. If this command runs after A. In this example, the task runs at A. Because the duration is 10 hours, the task is not run again at P. Instead, it starts again at A.
The following example schedules the MyApp program to run once a day, every day, at A. The following example schedules the MyApp program to run every twelve days at P. Because the task will run with the permissions of my user account, then the task will run only when I am logged on. The default is MON Monday. The following command schedules the MyApp program to run on a remote computer every six weeks.
Also, because the command is run remotely, all paths in the command, including the path to MyApp. The following command schedules a task to run every other Friday.
The default is 1 the first day of the month. The following command schedules the MyApp program to run on the first day of every month.
The following command schedules the MyApp program to run every three months. The following command schedules the MyApp program to run every other month on the 21st day of the month at midnight.
The command specifies that this task should run for one year, from July 2, to June 30, The "day of the week" schedule is a variation of the weekly schedule. The following command schedules the MyApp program to run every week on Wednesday.
The following command schedules a task to run on Monday and Friday of every eighth week. You can specify only one day of the week for this schedule type. The following command schedules the MyApp program to run on the second Sunday of every month.
You can specify only one day in the schedule. To schedule a task for the last day of the month, use the last day schedule type. Because the default modifier is none no modifier , the default day is day 1, and the default month is every month, the command does not need any additional parameters. The following command schedules the MyApp program to run on the last day of every month.
The following command schedules the MyApp program to run on the last day of February and the last day of March at P.
Schtasks does not permit you to schedule a task to run once if the date and time specified are in the past, based on the time of the local computer. To schedule a task that runs once on a remote computer in a different time zone, you must schedule it before that date and time occurs on the local computer. The following command schedules the MyApp program to run at midnight on January 1, The following command schedules the MyApp program to run every time the system starts, beginning on March 15, The "on logon" schedule type schedules a task that runs whenever any user logs on to the computer.
The following command schedules a batch file to run every time a user any user logs on to the remote computer. Because the command is remote, all paths in the command, including the path to the batch file, refer to a path on the remote computer.
0コメント