Link to home
Start Free TrialLog in
Avatar of Luis Diaz
Luis DiazFlag for Colombia

asked on

Windows batch & Powershell: get trigger of windows schedule tasks

Hello,
I need to export the various trigger of windows task scheduler in a csv & txt.
I supposed there is an option through cmd or powershell.

Could you please advice.
Thank you very much for your help.
Avatar of Bill Prew
Bill Prew

From a command line, the tool that I am aware of is schtasks, and it's ability to output tasks in XML format.  It contains the trigger info.  For example see below.  Output can of course be pipes to a text file for other usage...

schtasks /query /xml /tn "\Microsoft\Windows\Chkdsk\ProactiveScan"

Open in new window


»bp
Avatar of Luis Diaz

ASKER

Thank you for this proposal Bill.
Possible to get the information in a csv file with ";" delimiter?
Thank you again for your help.
What specific information?

Please provide a sample of the CSV you would want.


»bp
Please find attached the requested file.
WindowsTask.csv
I don't think this is going to work well.  The Actions and Triggers have a varying number of different parameters and formats, and have quite a bit of complexity to them.  To get a better feel for this run this command at a command prompt, and then browse the output file.  I think you will see that the information you are after is too complex and varying to easily fit into a CSV file.

schtasks /query /xml > schtasks.txt


»bp
ASKER CERTIFIED SOLUTION
Avatar of Bill Prew
Bill Prew

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Thank you very much Bill.