- SchTasks — управление планировщиком заданий из командной строки Windows.
- Schedule tasks from command line
- schtasks commands
- Required permissions
- How to create scheduled tasks with Command Prompt on Windows 10
- How to create a scheduled task using Command Prompt
- Task Scheduler create options
- How to change a scheduled task using Command Prompt
- Task Scheduler change options
- How to delete a scheduled task using Command Prompt
- Task Scheduler delete options
- More Windows 10 resources
- Mauro recommends all these affordable accessories
- Logitech MX Master Wireless Mouse ($72 at Amazon)
- Ktrio Extended Gaming Mouse Pad ($12 at Amazon)
- Supernight LED light strip ($20 at Amazon)
- The Dell XPS 15 is our choice for best 15-inch laptop
- Halo: MCC’s live service elements make it better, not worse
- Microsoft’s Surface Duo is not ‘failing up’
- These are the best PC sticks when you’re on the move
SchTasks — управление планировщиком заданий из командной строки Windows.
    Для планирования и автоматического выполнения заданий в среде Windows предусмотрено стандартное программное средство Планировщик заданий , который обеспечивает выполнение заранее подготовленных задач в определенное время, или при возникновении определенных событий, однократно или с периодичностью, в контексте системных или пользовательских учетных записей. Другими словами, с использованием Планировщика заданий можно по расписанию, или при возникновении определенного события, выполнить заранее подготовленные действия, например, проверить наличие обновлений, синхронизировать часы по серверу времени при входе в систему любого пользователя, выключить или перезагрузить компьютер, создать точку восстановления системы и т.п. Начиная с Windows Vista, Планировщик заданий стал основным инструментом обслуживания системы, без которого невозможно ее нормальное функционирование. Для управлениями запланированными задачами в среде графического интерфейса пользователя может использоваться консоль управления MMC ( Microsoft Management Console ) с модулем taskschd.msc или утилита командной строки Schtask.exe
Утилита schtasks.exe является стандартным средством управления планировщиком и позволяет создавать, удалять, изменять и опрашивать запланированные задачи на локальном или удаленном компьютере.
Формат командной строки SchTask:
SCHTASKS /параметр [аргументы]
Справку по отдельным параметрам команды можно получить используя:
SCHTASKS /Run /? — подсказка по использованию /Run
SCHTASKS /End /? — подсказка по использованию /End
Schedule tasks from command line
‘Schedule tasks‘ is a GUI application using which we can schedule tasks, There is an equivalent utility which provides the same functionality but with the advantage that it can be used from windows command line. This command is Schtasks. This is an in-built windows command supported by XP, Vista and Windows 7. Let’s see the syntax of this command with the help of few examples.
How to schedule a task ?
If you are logged into the same computer where you want to run the scheduled task, then you can use the below command to create the task.
Now let’s see few examples.
Example 1: Schedule disk defragmentation on every Saturday at 10AM. User credentials are administrator/password.
If the specified username and password are correct, then you would get the below message when you run the above command.
If the credentials are not correct, you may get a warning like below.
If there exists a scheduled task with the same name then the error would be:
If you need to use a domain user account to run the task you can specify domainname\username with /RU option.
How to get the list of scheduled tasks?
Just run Schtasks command and you can see the list of scheduled commands.
If you want complete details about each of the tasks you can run the command ‘Schtasks /query /v
DeleteВ a scheduled task
We can delete a schedule task using ‘schtasks /delete /TN task_name‘ command.В For example, to delete the task we created in the example 1 we can run the below command.
Delete all the scheduled tasks
You can run the below command to delete all the scheduled tasks.
Disable a scheduled task
There does not seem to be a way to disable a scheduled task from command line. We can delete the tasks as mentioned above.
ModifyВ a scheduled task:
We can change a scheduled task using ‘schtasks /change’ command. Run ‘schtasks /change /?’ for the syntax.
how to delete from the folder?
schtasks /delete /TN “Microsoft\Windows\Application Experience\Microsoft Compatibility Appraiser” /F
It is possibile to disable sheduled task. Here is an example:
schtasks /Change /TN “Microsoft\Windows\MUI\LPRemove” /Disable
How do you do it if the task is meant to be run on a DIFFERENT computer (like with the “connect to another computer”)? Thank you! On cmd please.
I’m regarding to run a batch file by a schedule task.
This script is running chrome with a specific url.
The problem is that I must choose some credential in my command line like this :
schtasks /create /sc once /tn Video_XP /tr “\\myserver\myscript.bat” /u contoso\admin /p mypassword /st 12:25:00
The problem is that the task is running with an other account than the login one.
If I replace /u by %username% i’m not able to specify the passord and the task will stuck in background requesting password.
Please tell how can I know whether a task is Enabled/Disabled using CMD queries
Please provide a Example supporting your answer.
what to add in cmd for sidebar execute properties, setting,
for this two things:
if the task fails, restart every: 30 minutes
also deselect stop the last if it runs longer den
Can I get the command to enable “Run whether user is logged in or not” option while scheduling task from command line.
Thanks in advance
Hello everybody!
I was forced to use win10 –
lot’s of automatic pop ups, reminders and other annoying stuff
called “features”. However:
My company is constructing high-level measurement devices.
(i’m doing electronics)
our win-develloper just committed suicide and i’m left with the crap…
(just kidding)
Please help me!
A pop up that wanted to update or install language-support popped up
and tried to connect to www to do some updates – Why?! The sys was running fine!
Since our devices are ment to work headless but only with a remote-access,
there will be no connection to www ever… So:
Q1) how to get win10 a bit more www-independent?
Back to the pop-ups: As a source of evel, i identified schtasks…
I don’t consider it smart, to have a let’s tidy-up-the harddrive-task starting in the bg,
or debugging when our customer just wants to shut down the system and is forced to wait.
So, what will be damaged (especially concerning wifi) when i just do
schtask /TN * /delete?
Thanks a lot for your answers!
(Sorry for my upset state…)
indigo
schtasks /Create /tn “mytask” /sc MINUTE /mo 1 /ru “myuser” /rp “mypassword” /tr “C:\Windows\System32\calc.exe”
this command does not run calculater.
Any help in this?
schtasks /Create /tn “mytask” /sc MINUTE /mo 1 /tr “C:\Windows\System32\calc.exe”
i guess you can run calc as a dif user, but no need to if youre just trying to add something. otherwise your syntax was incorrect and idk what your username and password were.
and you will want to run this after you get the above correct unless you want to see the calc open up every minute… 😉
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.
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. o run a task with permissions of a different user account or with system permissions, use the /ru parameter.
How to create scheduled tasks with Command Prompt on Windows 10
Windows 10 ships with Task Scheduler, which is an advanced tool that allows you to create and run routines automatically. Using this tool, you can automate tasks to perform all sorts of things, including launching an app, running a specific command, or executing a script at a specified day and time, or when a particular condition is met using triggers.
Although there’s a graphical experience to use Task Scheduler, you can also use Command Prompt to create, edit, and delete tasks, which can come in handy in many situations. For instance, when you need to speed up the process to create the same task on multiple computers, and when building an application or script that needs to connect with the tool — just to name a few.
In this Windows 10 guide, we’ll walk you through the steps to get started managing scheduled tasks using the schtasks.exe tool on Command Prompt.
How to create a scheduled task using Command Prompt
To create a scheduled task with Command Prompt on Windows 10, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
Type the following command to create a daily task to run an app at 11:00am and press Enter:
Syntax
SCHTASKS /CREATE /SC DAILY /TN «FOLDERPATH\TASKNAME» /TR «C:\SOURCE\FOLDER\APP-OR-SCRIPT» /ST HH:MM
Example
SCHTASKS /CREATE /SC DAILY /TN «MyTasks\Notepad task» /TR «C:\Windows\System32\notepad.exe» /ST 11:00
Quick tip: The folder path before the task name, under the /TN option, is not a requirement, but it’ll help you to keep your tasks separate. If you don’t specify a path, the task will be created inside the Task Scheduler Library folder.
Type the following command to create a weekly task to run an app at 11:00am and press Enter:
Syntax
SCHTASKS /CREATE /SC WEEKLY /D SUN /TN «FOLDERPATH\TASKNAME» /TR «C:\SOURCE\FOLDER\APP-OR-SCRIPT» /ST HH:MM
Example
SCHTASKS /CREATE /SC WEEKLY /D SUN /TN «MyTasks\Notepad task» /TR «C:\Windows\System32\notepad.exe» /ST 11:00
Type the following command to create a monthly task to run an app at 11:00am and press Enter:
Syntax
SCHTASKS /CREATE /SC MONTHLY /D 15 /TN «FOLDERPATH\TASKNAME» /TR «C:\SOURCE\FOLDER\APP-OR-SCRIPT» /ST HH:MM
Example
SCHTASKS /CREATE /SC MONTHLY /D 15 /TN «MyTasks\Notepad task» /TR «C:\Windows\System32\notepad.exe» /ST 11:00
Type the following command to create a scheduled task that runs daily as a specific user and press Enter:
Syntax
SCHTASKS /CREATE /SC DAILY /TN «FOLDERPATH\TASKNAME» /TR «C:\SOURCE\FOLDER\APP-OR-SCRIPT» /ST HH:MM /RU USER-ACCOUNT
Example
SCHTASKS /CREATE /SC DAILY /TN «MyTasks\Notepad task» /TR «C:\Windows\System32\notepad.exe» /ST 11:00 /RU admin
Once you complete the steps, the task will run during the intervals you specified.
Task Scheduler create options
The command line version of Task Scheduler ships with many options allowing to customize many aspects of a task, and in this guide, we are using the following options to change a scheduled task:
- /CREATE — specifies that you want to create a new an automated routine.
- /SC — defines the schedule for the task. Options available, include MINUTE, HOURLY, DAILY, WEEKLY, MONTHLY, ONCE, ONSTART, ONLOGON, ONIDLE, and ONEVENT.
- /D — specifies the day of the week to execute the task. Options available, include MON, TUE, WED, THU, FRI, SAT, and SUN. If you’re using the MONTHLY option, then you can use 1 — 31 for the days of the month. Also, there’s the wildcard «*» that specifies all days.
- /TN — specifies the task name and location. The «MyTasks\Notepad task» uses the «Notepad task» as the name and stores the task in the «MyTasks» folder. If the folder isn’t available, it’ll be created automatically.
- /TR — specifies the location and the name of the task that you want to run. You can select an app or custom script.
- /ST — defines the time to run the task (in 24 hours format).
- /QUERY — displays all the system tasks.
- /RU — specifies the task to run under a specific user account.
These are just some of the available options. You can learn more about the options to create a scheduled task running the SCHTASKS /CREATE /? command.
How to change a scheduled task using Command Prompt
To modify a scheduled task on Windows 10 with Command Prompt, use these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
Type the following command to change the time to run the task 9:00am and press Enter:
Syntax
SCHTASKS /CHANGE /TN «FOLDERPATH\TASKNAME» /ST HH:MM
Example
SCHTASKS /CHANGE /TN «MyTasks\Notepad task» /ST 09:00
Type the following command to change the task user information and press Enter:
Syntax
SCHTASKS /CHANGE /TN «FOLDERPATH\TASKNAME» /RU NEW-USERNAME
Example
SCHTASKS /CHANGE /TN «MyTasks\Notepad task» /RU admin2
Type the following command to disable a scheduled task and press Enter:
Syntax
SCHTASKS /CHANGE /TN «FOLDERPATH\TASKNAME» /DISABLE
Example
SCHTASKS /CHANGE /TN «MyTasks\Notepad task» /DISABLE
Quick tip: If you want to re-enable the task, you can use the same command, but make sure to use the /ENABLE option instead.
After completing the steps, the task will be modified with the information that you’ve specified.
Task Scheduler change options
In this guide, we are using the following options to create a scheduled task:
- /CHANGE — specifies that you want to edit an existing task.
- /TN — specifies the name and location of the task that you want to modify.
- /ST — defines the new time to run the automated routine.
- /DISABLE — disables the task.
These are just some of the available options. You can learn more about the options to change a scheduled task running the SCHTASKS /CHANGE /? command.
How to delete a scheduled task using Command Prompt
If you no longer need a particular task, you can delete it using these steps:
- Open Start.
- Search for Command Prompt, right-click the top result, and select the Run as administrator option.
Type the following command to delete a scheduled task and press Enter:
Syntax
SchTask /DELETE /TX «FOLDERPATH\TASKNAME»
Example
SCHTASKS /DELETE /TN «MyTasks\Notepad task»
Press the Y key to confirm.
Once you complete the steps, the task will be removed, and it’ll no longer be available on your device.
Task Scheduler delete options
In this guide, we are using the following options to delete a scheduled task:
- /DELETE — specifies that you want to delete an existing task.
- /TN — specifies the name and location of the task that you want to delete.
We’re focusing this guide on Windows 10, but the ability to use Task Scheduler with Command Prompt has been around for a long time, which means that you can also use these steps on Windows 8.1 and Windows 7.
More Windows 10 resources
For more helpful articles, coverage, and answers to common questions about Windows 10, visit the following resources:
Mauro recommends all these affordable accessories
Hi, I’m Mauro Huculak, Windows Central’s help and how-to guru. I wrote the post you’re reading now, and I know the Windows OS inside and out. But I’m also a bit of a hardware geek. These are some of the affordable gadgets on my desk today.
Logitech MX Master Wireless Mouse ($72 at Amazon)
I know mice, and this is the one I use every day. The MX Master is a wireless high-precision mouse that’s very comfortable to use and has many great features, including the ability to connect with multiple devices, an infinite scroll wheel, back and forward buttons, all of which you can customize.
Ktrio Extended Gaming Mouse Pad ($12 at Amazon)
If you spend a lot of time typing, your palms and mouse will leave tracks on your desk. My solution was to start using gaming mouse pads, which are big enough for you to use the keyboard and the mouse comfortably. This is the one I use and recommend.
Supernight LED light strip ($20 at Amazon)
You could just use a regular light bulb in your office, but if you want to add some ambient lighting with different colors, an RGB LED strip is the way to go. This one is Mauro-approved.
We may earn a commission for purchases using our links. Learn more.
The Dell XPS 15 is our choice for best 15-inch laptop
For a lot of people, a 15-inch laptop is a perfect size that offers enough screen for multitasking, and in a lot of cases, some extra performance from powerful hardware. We’ve rounded up the best of the best at this size.
Halo: MCC’s live service elements make it better, not worse
Halo: The Master Chief Collection is more popular than ever, but some fans don’t agree with the live service approach 343 Industries has taken with it. Here’s why those elements are, at the end of the day, great for the game and for Halo overall.
Microsoft’s Surface Duo is not ‘failing up’
Microsoft announced this week that it was expanding Surface Duo availability to nine new commercial markets. While Surface Duo is undoubtedly a work in progress, this is not a sign of a disaster. It’s also doesn’t mean that Surface Duo is selling a ton either. Instead, the reason for the expansion is a lot more straightforward.
These are the best PC sticks when you’re on the move
Instant computer — just add a screen. That’s the general idea behind the ultra-portable PC, but it can be hard to know which one you want. Relax, we have you covered!