Filter list of scheduled tasks by taskname
Asked Answered
P

3

12

running the cmd command

schtasks /query /fo LIST

Gives me a list of all scheduled tasks running on my system. Example:

HostName:      CHESTNUT105B
TaskName:      Calculator
Next Run Time: 12:00:00, 10/28/2010
Status:        Running

HostName:      CHESTNUT105B
TaskName:      GoogleUpdateTaskMachineCore
Next Run Time: At logon time
Status:

HostName:      CHESTNUT105B
TaskName:      GoogleUpdateTaskMachineCore
Next Run Time: 13:02:00, 10/28/2010
Status:

HostName:      CHESTNUT105B
TaskName:      GoogleUpdateTaskMachineUA
Next Run Time: 17:02:00, 10/27/2010
Status:

How can I filter the list so it only shows me the details of the task 'Calculator' ?

the \tn argument gives me an error Invalid Argument / Option

Percent answered 27/10, 2010 at 20:34 Comment(0)
C
12

Use / instead of \. This works just fine.

schtasks /query /fo LIST /tn Calculator
Connie answered 12/10, 2011 at 22:0 Comment(3)
in windows 7x64 when i put the /tn switch always gives error... tryed several ways with/without quotes in the task name... no luck... one more 'shitty MS thang'...Albumen
ca you use wildcards in the /tn argument ?Albumen
this example from next answer clarifies the usage of backslash in tn. schtasks /Query /TN \Microsoft\Windows\Backup\Microsoft-Windows-WindowsBackupBait
O
3

Unfortunatly I can not add a comment to ZEE's comment (not enough "reputation").

With the /TN switch you have to use the "path" - containing the folder in the task scheduler. Or you get an error:

"ERROR: The system cannot find the file specified."

For example:

schtasks /Query /TN \Microsoft\Windows\Backup\Microsoft-Windows-WindowsBackup

(see also Jonathon Kellers Blog: http://www.jonathankeller.com/2012/02/schtasks-query-tn-tasks-over-network.html).

For better output I recommend the switch "/fo list" -> output as a list and verbose "/v":

schtasks /Query /TN \Microsoft\Windows\Backup\Microsoft-Windows-WindowsBackup /fo list /v
Observatory answered 2/2, 2018 at 15:55 Comment(0)
N
1
schtasks /query /fo LIST | findstr "Calculator"
Nonsuit answered 20/10, 2023 at 8:50 Comment(0)

© 2022 - 2024 — McMap. All rights reserved.