How to Use the schtasks Command to Manage Scheduled Tasks in Windows 11

The Limits of the Task Scheduler GUI

Windows 11 includes a powerful built-in utility called the Task Scheduler. It allows you to automate repetitive actions—such as running a custom PowerShell backup script every Friday at 5:00 PM, or launching a specific application every time you log into your computer.

While you can use the graphical Task Scheduler window to create these jobs, doing so across dozens of computers in a corporate environment is tedious. If you are an IT administrator, you cannot afford to manually click through five different menu screens on fifty different laptops just to schedule a single script.

To automate the automation, you can use the schtasks command. This incredibly robust command-line tool allows you to create, delete, query, and modify scheduled tasks instantly, directly from the Command Prompt.

Step 1: Open the Command Prompt

Because you are interacting with system-level automation services, you must use an elevated terminal.

  1. Press the Windows Key, type cmd.
  2. Right-click on Command Prompt and select Run as administrator.

Step 2: Creating a Basic Scheduled Task

Assume you have a custom script located at C:\Scripts\WeeklyBackup.bat. You want this script to run automatically every Friday at exactly 5:00 PM (17:00).

You can create this task instantly using the /Create flag.

schtasks /Create /TN "FinanceBackup" /TR "C:\Scripts\WeeklyBackup.bat" /SC WEEKLY /D FRI /ST 17:00

Breaking down the command:

  • /TN “FinanceBackup”: The Task Name. This is the official label that will appear in the Task Scheduler list.
  • /TR “…”: The Task Run path. This tells the scheduler exactly which file or program to execute.
  • /SC WEEKLY: The Schedule type (e.g., DAILY, WEEKLY, MONTHLY, ONLOGON).
  • /D FRI: The specific Day of the week.
  • /ST 17:00: The Start Time (using a 24-hour clock format).

The terminal will instantly reply: “SUCCESS: The scheduled task “FinanceBackup” has successfully been created.”

Step 3: Creating a Task Triggered by Logon

Time-based schedules are useful, but sometimes you want a program to launch immediately when a user sits down at their desk, regardless of the time on the clock.

If you want a custom welcome script (C:\Scripts\Welcome.exe) to run the moment anyone logs into the computer, change the schedule type to ONLOGON.

schtasks /Create /TN "WelcomeScreen" /TR "C:\Scripts\Welcome.exe" /SC ONLOGON

Step 4: Querying Existing Tasks

If you want to see a list of all custom tasks currently scheduled on the machine to ensure your new task was registered correctly, use the /Query flag.

Because Windows has hundreds of background tasks running by default, it is best to filter the query specifically for the task name you just created to see its exact status and the next scheduled run time.

schtasks /Query /TN "FinanceBackup"

Step 5: Deleting a Task

If a specific script is no longer needed, you should remove the scheduled task so the computer does not waste resources attempting to run a deleted file.

To permanently delete a task, use the /Delete flag, followed by the Task Name. You must also include the /F (force) flag to bypass the final “Are you sure?” confirmation prompt, which is essential if you are running this command via a silent deployment script.

schtasks /Delete /TN "FinanceBackup" /F

Get the best tech tips delivered straight to your inbox.

Join thousands of readers mastering Apple, Google, Microsoft, and Linux.