dahall / TaskScheduler

Provides a .NET wrapper for the Windows Task Scheduler. It aggregates the multiple versions, provides an editor and allows for localization.
MIT License
1.21k stars 191 forks source link

Questions for TaskScheduler #854

Closed Torchok19081986 closed 3 years ago

Torchok19081986 commented 3 years ago

Hallo, i create a complexe software and want to know , few info for taskscheduler.

  1. How do i get last 2 Results of my task ? I have a dailytrigger, which runs once in a day, and i would like to show last 2 days results of tasks, if task was successful or not.
  2. If i would create task for something on dailytrigger, task will be created in windows scheduler, works fine. But i would to bind it to my complexe GUI and show there some more info in my programm, without call windows taskscheduler from widnows? Is there some way to achive that? Many Thanks .
dahall commented 3 years ago
  1. The last run result code is available as a property to the Task object. To get the error code for runs previous to the last, use the TaskEventLog class and look for the successful runs.
  2. There are many WinForms controls that mimic the display in the Windows Task Scheduler app in my TaskScheduler Editor library that can be embedded in any app. If not, you can build your own using TaskEventLog and Task.