Since refresh doesn't work for the TaskScheduler, how open are you to creating your own monitoring tool of the Windows 7 TaskScheduler? There is a library in the
codeplex that offers some insight into TaskScheduler.
Below is just an example of accessing certain properties of scheduled tasks. There is no output or anything, but a simple gui or tray-based application could alert you every
n number of minutes for certain types of task status. What would be better is if I can find events that were exposed to catch when a task has changed state, etc, but I don't see them with this library. The next best case is to define your own polling value and have it update that way.
Code:
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Win32.TaskScheduler;
namespace WinTaskScheduler
{
class Program
{
static void Main(string[] args)
{
using (TaskService ts = new TaskService())
{
RunningTaskCollection rtc = ts.GetRunningTasks();
foreach(Task t in rtc)
{
if (t.Enabled)
{
String name = t.Name;
DateTime dt = t.LastRunTime;
int lastResult = t.LastTaskResult;
DateTime nextRun = t.NextRunTime;
int numRuns = t.NumberOfMissedRuns;
String path = t.Path;
TaskState taskState = t.State; //taskState.ToString();
}
}
}
}
}
}