← Back to docs
Tools - Applications•Updated: November 23, 2024
schtasks
Create, delete, query, or run scheduled tasks.
schtasks
Command: schtasks
Category: Applications
Type: CMD
Purpose
A command-line tool for managing scheduled tasks in Windows. Use it to create, delete, run, query, or modify tasks that run automatically at specified times or in response to system events.
Quick Summary
Schedule tasks gives you complete control over Windows Task Scheduler from the command line. Create automated maintenance scripts, schedule regular backups, or manage existing tasks without opening the GUI. It's ideal for scripting and remote administration.
How to Use
Common commands:
- Query tasks:
schtasks /query - Query with details:
schtasks /query /fo LIST /v - Create a task:
schtasks /create /tn "TaskName" /tr "C:\path\to\program.exe" /sc daily /st 09:00 - Run a task immediately:
schtasks /run /tn "TaskName" - Delete a task:
schtasks /delete /tn "TaskName" /f
Tips and Best Practices
- Use
/query /fo LIST /vfor detailed, readable output of all tasks. - Test tasks with
/runbefore setting up schedules. - Use
/fparameter with delete to skip confirmation prompts in scripts. - Create tasks with descriptive names to make management easier.
- Document complex task parameters for future reference.
Common Use Cases
- System maintenance: Schedule regular disk cleanup, backups, or updates.
- Automation: Run scripts at specific times or intervals.
- Remote management: Manage scheduled tasks on remote computers.
- Troubleshooting: Identify and remove problematic or unnecessary scheduled tasks.
Prerequisites
- Windows Command Prompt or PowerShell
- Administrator rights required for most operations (creating, deleting, running tasks)
- Standard user can query their own tasks
Troubleshooting
- "Access is denied" - Run Command Prompt as Administrator.
- "The system cannot find the file specified" - Verify the path in the /tr parameter is correct and accessible.
- Task doesn't run - Check task conditions (e.g., "only if computer is on AC power") and triggers in Task Scheduler.
- Error 0x1 - The task ran but the program/script had an error. Check the program directly.
Related Tools
taskschd.msc- GUI for Task Scheduler managementat- Legacy command for scheduling tasks (deprecated, use schtasks instead)