Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Filter list of scheduled tasks by taskname

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

like image 848
xbonez Avatar asked Oct 27 '10 20:10

xbonez


People also ask

How do I get a list of scheduled tasks?

To open Scheduled Tasks, click Start, click All Programs, point to Accessories, point to System Tools, and then click Scheduled Tasks. Use the Search option to search for "Schedule" and choose "Schedule Task" to open the Task Scheduler. Select the "Task Scheduler Library" to see a list of your Scheduled Tasks.

How do I get Task Scheduler list in PowerShell?

To retrieve the existing tasks in the task scheduler using PowerShell, we can use the PowerShell command Get-ScheduledTask. We can use the Task Scheduler GUI to retrieve the scheduled tasks. To retrieve using PowerShell, use the Get-ScheduledTask command.

Which command is used to list scheduled jobs?

Overview of the at command. You can use the at command to schedule a command, a script, or a program to run at a specified date and time. You can also use this command to view existing scheduled tasks.


2 Answers

Use / instead of \. This works just fine.

schtasks /query /fo LIST /tn Calculator
like image 88
refaim Avatar answered Oct 01 '22 13:10

refaim


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
like image 42
S. Gran Avatar answered Oct 01 '22 13:10

S. Gran