I just read this: What is the benefit of developing the application as a windows service? but I\'m still unsure of when to use a windows service.
I have a couple tas
I would recommend a scheduled task in all cases except programs that need to run at very short intervals, or that run continuously. Programs that start, perform their function, and shutdown have well defined resource lifetimes, perform the appropriate setup and cleanup in a bounded number of steps (and if not, the fact that they don't terminate in the expected time is indication of a bug), and thus are easier to reason about. And you don't need to fiddle about with timers and such.
Scheduled tasks have equivalent operations to the stop and restart commands of services, ie. disable task, enable task. Simple, and it lets any current operations in progress complete instead of trying to abort them, which is inherently correct way to handle this. Doing all of this state/transition management resource lifetimes manually is just error-prone in the presence of refactoring.