4
Answers

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

r p

r p

12y
3.4k
1

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)