Wednesday, February 04, 2015

Making TaskScheduler More Useful

A long time ago, I blogged about a couple of classes I wrote to schedule tasks using the Windows Task Scheduler. We use these classes in Stonefield Query to schedule report runs.

Recently, I add a few methods to the VistaTaskScheduler class (so named because it works using the Task Scheduler 2.0 API, which was added starting in Windows Vista; it works in Windows 7, 8, 8.1, and I’m guessing 10 as well) to enumerate tasks (GetTask), get a specific task (GetTask), and delete a task (DeleteTask). I added these because we’re adding a Scheduled Tasks dialog in the next version of Stonefield Query that’ll allow you to see which reports you’ve scheduled, see when the last time a schedule was run and what the result was, edit the settings of a schedule, and delete a schedule, all without having to open the Windows Task Scheduler.

You can download the updated code from the Technical Papers page of my web site.

No comments: