How to run a Windows service at a specified time daily

I need to schedule a Windows service daily at a predetermined time to start, and then sleep until the next day. How can i do this?

Decision:

A timer has been added to time out every 30 minutes, and then confirm if the time of day has reached, if so, then perform the required function, make sure to check the flag after it is completed during the day.

+4
source share
3 answers

Not. You set up a scheduled task; services (usually) for background running processes.

+14
source

You can start or stop the service using a batch file.

More here

Then just add the scheduled task to start or stop the batch file

0
source

Source: https://habr.com/ru/post/1303116/


All Articles