Click here to Skip to main content
15,867,835 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
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

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
 
Share this answer
 
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, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900