I am working on a window service and I have to schedule it. Schedule is set to any three days of a week and four times a day. At any time when one starts service, It must pick the next execution time.
This next execution time can be in the same day or next scheduled day(may be with the gap of a day or two).
Take a look at Task Scheduler Managed Library (Codeplex). I believe it is maintained by Microsoft themselves.
Once you add the DLL reference to
Microsoft.Win32.TaskScheduler, you can use it really easily like so:That will register a task that runs every Friday, executing YourProgram.exe.