This project has moved and is read-only. For the latest updates, please go here.

Last Run Result of any task

Topics: Examples, Setup
Sep 20, 2014 at 1:02 PM
Edited Sep 20, 2014 at 1:03 PM

I want to know the last run result of some of the tasks scheduled in windows scheduler. How can I get that information using this library?
I tried using "LastTaskResult" property of "Task" class but it is returning different integer values from which I am not able to figure the last run result of tasks.
Please respond to this thread.

Thanks in advance.
Sep 20, 2014 at 4:36 PM
The only two properties that report on the results of the last execution of a task are LastRunTime and LastTaskResult. LastRunTime gives the time when the execution started and LastRunResult gives the exit code for the executable specified in the task's ExecAction that fired.

For a bunch more detail, you can create a TaskEventLog object for the task and iterate through the events fired by the task. However, depending on how your task reports its result, this may not give an answer either.