Jane Dallaway

Jane Dallaway

Jane Dallaway  //  Data loving developer/leader/product shaper, storyline curator/creator, life-long learner, photographer, dog owner, reader, crafter, gardener and occasional snowboarder

This blog contains all sorts of odds and ends, from event reviews, stuff about my storyline project, bits of craft, through thoughts on learning, to photography stuff, and general inspiration things. It's a bit all over the place with no real theme, but then so am I!

Email: jane @ dallaway.com
Also at:    

NTS: Get a list of windows scheduled tasks

I've been working on support for a while, and one of my tasks involved checking the set up of a windows scheduled task. I wanted to script out the scheduled tasks, so I could review them in an easier manner than having to use the GUI and navigating through them all.

The dos command schtasks holds the key. So, after opening a command prompt, the command

  schtasks /query

produces a list of all the scheduled tasks, including Task Name, Next Run Time and Status.
I wanted a bit more detail, specifically the path of what was scheduled, so I used the command

  schtasks /query /v /fo LIST

which produces a detailed list of all tasks. This includes additional information such as the task being run, schedule information etc
Finally, to get the output in a CSV format I used

  schtasks /query /v /fo CSV

This produces the same quantity of detailed information as LIST.

So, finally, by piping the output

  schtasks /query /v /fo CSV > tasks.csv

I get a tasks.csv file which I can open in Excel and review for correctness and completeness.

Filed under  //  dos   nts  

Comments (1)