r p

r p

  • NA
  • 343
  • 0

How to Start and Stop Windows Web Service programically using Windows Task Scheduler once a day

Oct 2 2012 12:43 PM

I have a windows service to send emails every night at 12am.
I want it to start and stop it with the help of a windows task scheduler. 
I thought using Windows Start Scheduler may be the best option and run the windows service using a bat file like - NET START "Myservice".
But, after it runs for the first day, it does not stop. 
How can I make it stop after completing the email sending process?

Is using Windows Task scheduler better than thread for services running once a day?


Answers (4)