Schtasks 找不到计划任务

Schtasks doesn't find scheduled task

使用schtasks /query /tn tasknameschtasks /delete /tn taskname似乎找不到我的任务,总是returns"The system couldn't find the specified task" .

但是,如果我执行 schktasks /query 它会显示任务,我已经尝试提供 /delete 方法的完整路径,但是错误是一样的。

我做错了什么?

任务按文件夹组织,因此需要指定任务的完整路径,否则只会列出根任务:

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.

使用/f(强制动作)开关:

schtasks /f /delete /tn \Microsoft\Windows\AppID\test

SUCCESS: The scheduled task "\Microsoft\Windows\AppID\test" was successfully deleted.

路径显示在 schtasks /query 的输出中 Folder: 标签之后。