Remember to maintain security and privacy. Do not share sensitive information. Procedimento.com.br may make mistakes. Verify important information. Termo de Responsabilidade
Scheduled tasks are an essential feature in Windows that allow users to automate repetitive tasks, run scripts, and perform maintenance activities at specified times or intervals. This article will guide you through the process of creating, managing, and executing scheduled tasks using both the graphical user interface (GUI) and command-line tools like Command Prompt (CMD) and PowerShell.
Open Task Scheduler:
Win + R
, type taskschd.msc
, and press Enter.Create a Basic Task:
Set the Trigger:
Set the Action:
Finish:
Open Command Prompt:
Win + R
, type cmd
, and press Enter.Create the Task:
schtasks
command to create a scheduled task. For example, to run a script daily at 10 AM:
schtasks /create /tn "DailyScript" /tr "C:\Scripts\MyScript.bat" /sc daily /st 10:00
Open PowerShell:
Win + R
, type powershell
, and press Enter.Create the Task:
New-ScheduledTaskTrigger
, New-ScheduledTaskAction
, and Register-ScheduledTask
cmdlets. For example:
$trigger = New-ScheduledTaskTrigger -Daily -At 10:00AM
$action = New-ScheduledTaskAction -Execute "C:\Scripts\MyScript.bat"
Register-ScheduledTask -TaskName "DailyScript" -Trigger $trigger -Action $action -User "SYSTEM"
Open Command Prompt:
Win + R
, type cmd
, and press Enter.List the Tasks:
schtasks
command to list all scheduled tasks:
schtasks /query /fo LIST /v
Open Command Prompt:
Win + R
, type cmd
, and press Enter.Delete the Task:
schtasks
command to delete a scheduled task:
schtasks /delete /tn "DailyScript" /f
Scheduled tasks in Windows provide a powerful way to automate tasks and ensure that important scripts and programs run at the right times. Whether you prefer using the GUI, Command Prompt, or PowerShell, Windows offers multiple methods to create, manage, and delete scheduled tasks.