Reputation: 521
using schtasks /query /tn taskname
or schtasks /delete /tn taskname
doesn't seem to find my task, always returns "The system couldn't find the specified task"
.
However, if i do a schktasks /query
it shows the task, i've tried providing the fullpath to the /delete method, however the error was the same.
What am i doing wrong?
Upvotes: 2
Views: 9170
Reputation: 73846
Tasks are organized in folders so it is necessary to specify a full path of the task, otherwise only the root tasks will be listed:
schtasks /query /v /fo list /tn \Microsoft\Windows\Wininet\CacheTask
Folder: \Microsoft\Windows\Wininet
HostName: ZOO
TaskName: \Microsoft\Windows\Wininet\CacheTask
Next Run Time: N/A
Status: Running
Logon Mode: Interactive/Background
Last Run Time: 25.08.2015 20:02:17
Last Result: 267009
Author: Microsoft
Task To Run: COM handler
Start In: N/A
Comment: Wininet Cache Task
Scheduled Task State: Enabled
Idle Time: Disabled
Power Management:
Run As User: Users
Delete Task If Not Rescheduled: Enabled
Stop Task If Runs X Hours and X Mins: Disabled
Schedule: Scheduling data is not available in this format.
Schedule Type: At logon time
Start Time: N/A
Start Date: N/A
End Date: N/A
Days: N/A
Months: N/A
Repeat: Every: N/A
Repeat: Until: Time: N/A
Repeat: Until: Duration: N/A
Repeat: Stop If Still Running: N/A
schtasks /delete /tn \Microsoft\Windows\AppID\test
WARNING: Are you sure you want to remove the task "\Microsoft\Windows\AppID\test" (Y/N)? y
SUCCESS: The scheduled task "\Microsoft\Windows\AppID\test" was successfully deleted.
Using /f
(force action) switch:
schtasks /f /delete /tn \Microsoft\Windows\AppID\test
SUCCESS: The scheduled task "\Microsoft\Windows\AppID\test" was successfully deleted.
The path is shown in the output of schtasks /query
after Folder:
label.
Upvotes: 4