windows services

  • Thread starter Thread starter CK
  • Start date Start date
Hi,

Nop, you have two choises:
1- Use a timer to run the required code
2- If all what the service does is this, just use a scheduled job as willy
suggested.


cheers,
 
CK said:
Is there a way to tell a windows service to run between 9 am to 10 am?

Create a batch file (e.g. service.cmd), containing:
<snip>
@net %1 yourServiceName
</snip>

open a command prompt and enter:

at 9:00 /every:M,T,W,Th,F,S,Su "c:\Path\To\service.cmd start"

at 10:00 /every:M,T,W,Th,F,S,Su "c:\Path\To\service.cmd stop"

This will schedule your service to start every day at 9 am and stop it
at 10 am.


/B.scheduling
 
Why having a service that get's schudeled from the task scheduler?
The application should not be a service, it should be a simple console
application that get's scheduled to run at 9.00 every day and run until
finished.

Willy.
 
Back
Top