| View previous topic :: View next topic |
| Author |
Message |
harry Contributor


Joined: 01 May 2003 Posts: 61
|
Posted: Wed Jan 02, 2008 9:01 pm Post subject: have program wait a month? |
|
|
hi guys,
say what is the best way to have a program wait for
30 days and then to do its job and then wait untill the end on the next month and repeat?
oh yeah its with vds4
thanks _________________ most computer errors happen between the keyboard and the chair |
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Wed Jan 02, 2008 9:14 pm Post subject: |
|
|
Use Windows Scheduler to run the program when required. _________________ John Trappett |
|
| Back to top |
|
 |
harry Contributor


Joined: 01 May 2003 Posts: 61
|
Posted: Wed Jan 02, 2008 11:24 pm Post subject: |
|
|
any other route??? _________________ most computer errors happen between the keyboard and the chair |
|
| Back to top |
|
 |
trapper Contributor


Joined: 28 Jan 2005 Posts: 112 Location: Brisbane, Australia
|
Posted: Wed Jan 02, 2008 11:52 pm Post subject: |
|
|
| harry wrote: | | any other route??? |
You could do it within the program itself... but why would you want to have a program sitting idling each month only to do something at the end of the month? It seems to me that this is the sort of thing that the Windows Scheduler is perfectly suited to. _________________ John Trappett |
|
| Back to top |
|
 |
PGWARE Web Host

Joined: 29 Dec 2001 Posts: 1565
|
Posted: Thu Jan 03, 2008 12:04 am Post subject: |
|
|
If it's being run on a server than waiting 30 days may be okay, but if it's on a client/user machine it's likely it will be rebooted several times between that time.
Have your application run on Windows startup. You should write a date to the registry and have your application check if it is past this date, if so then execute the applications code; otherwise have it close the application so it doesn't use up system resources unnecessarily.
The windows scheduler is the best idea since you don't have to execute the application until it is exactly at a certain date/time - however if the date/time passes and the computer was not on then the scheduler won't execute - using the windows startup method noted above will be better in this case. |
|
| Back to top |
|
 |
|