Click here to Skip to main content
14,421,405 members
Rate this:
Please Sign up or sign in to vote.
See more:
Hi,

I am unable to trace how to schedule my Windows Service to run at specific intervals:(

I want it to run every Tuesday and Friday at 3 pm...
Need some help regarding how to achieve this functionality..

Thanks
Posted

1 solution

Rate this:
Please Sign up or sign in to vote.

Solution 1

What you probably want, can easily be accomplished using the Task Scheduler API[^]

You can use something like this A New Task Scheduler Class Library for .NET[^] to develop your solution in c# or just import the COM interfaces yourself.

The really easy solution is to use the tools included with windows[^].

Another benefit is that your solution no longer needs to be implemented as a service :) - it will be executed under the scheduler service, and will run even if there is no currently logged on user.

Regards
Espen Harlinn
   
Comments
Sandeep Mewara 14-Feb-11 8:01am
   
Good answer! 5+
Espen Harlinn 14-Feb-11 10:04am
   
Thanks Sandeep!
Sergey Alexandrovich Kryukov 14-Feb-11 11:14am
   
Yes, good answer, my 5.
Only I'm not sure one can use that "tools included with windows" with Windows Service. I though this is to schedule regular application (this is what I did), is it not?
--SA
Espen Harlinn 14-Feb-11 14:18pm
   
Thanks SAKryukov, btw: you are right - the scheduling service runs regular applications, but you do not need an interactive logged on session.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)




CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100