Board index » delphi » schedule time?

schedule time?


2004-01-30 05:56:51 AM
delphi227
My program is a maintained purpose program. It need to cleanup some files at
midnight when it is a rollover of day. How to implement that? Put a timer and
check the time value with an old value (base on date) within every few
seconds? Other ways are around? Thanks.
 
 

Re:schedule time?

Add the exe to the windows task scheduler.
Ben
"JS" <XXXX@XXXXX.COM>writes
Quote
My program is a maintained purpose program. It need to cleanup some files
at
midnight when it is a rollover of day. How to implement that? Put a timer
and
check the time value with an old value (base on date) within every few
seconds? Other ways are around? Thanks.


 

Re:schedule time?

The requirement is need to reside on the application to detector the time.
Can I do this way:
Repopulate an array like this(base on the oldest file's date):
Date - Status
30/01/2004 12:01 AM - done.
31/01/2004 12:01 AM -
...
And compare with the OS time using timer by one hour, if it is right after
the day 12:01 AM. then do the job.
Thanks...
"Bill Todd (TeamB)" <XXXX@XXXXX.COM>writes
Quote
On Thu, 29 Jan 2004 16:56:51 -0500, "JS" <XXXX@XXXXX.COM>
writes:

>My program is a maintained purpose program. It need to cleanup some files
at
>midnight when it is a rollover of day. How to implement that? Put a timer
and
>check the time value with an old value (base on date) within every few
>seconds? Other ways are around? Thanks.
>

Alternatives are:

1) Write a Windows service that watches the clock and takes the
required action at midnight.

2) Write a console application and call it from a batch file. You can
run the batch file automatically at midnight using Windows Scheduler.

--
Bill (TeamB)
(TeamB cannot respond to questions received via email)