1. Computing

Working with TaskScheduler in C#

By January 24, 2013

Follow me on:

Linux has its Crontab, but Windows since 98 has had a task scheduler. There's also the At command which used to have a major security flaw in it back in Win NT days. Because it ran at system level, you could access hidden areas in the registry with a program run under it.

A new version of task scheduler was introduced with Vista. This Codeplex hosted Wrapper in C# makes working with the task scheduler (older and newer versions) a bit simpler. You can use it for creating tasks automatically with code like this:

new TaskService().AddTask("Test", new DailyTrigger { DaysInterval = 2 }, new ExecAction("notepad.exe", "c:\\test.log", null));
Comments are closed for this post.
Leave a Comment

Line and paragraph breaks are automatic. Some HTML allowed: <a href="" title="">, <b>, <i>, <strike>

©2014 About.com. All rights reserved.