WinBatch Tech Support Home

Database Search

If you can't find the information using the categories below, post a question over in our WinBatch Tech Support Forum.

TechHome

Time - Timer and Date Functions
plus

Can't find the information you are looking for here? Then leave a message over on our WinBatch Tech Support Forum.

Run Script Once a Day

Keywords: timeymdhms once a day Timer Script Every Day startup

Question:
How would I write a script that runs once, and ONLY once a day when the user starts their machine. The problem is if they reboot at any time through out the day, I do not want the script to run again.

Answer:

Put the following script in the Windows | startup subdirectory.....

A Timer Script to Start once a day upon startup:


myinifile = "OnceADay.ini"
now = TimeYMDHMS()
today = StrSub(now, 1, 10)
test = IniReadPvt("MAIN", "OnceADay", 0, myinifile)
if test == today then exit
IniWritePvt("MAIN", "OnceADay", today, myinifile)
;<<<<<< DO STUFF HERE >>>>>>>
exit


Article ID:   W13880
Filename:   Run Script Once a Day.txt
File Created: 2001:01:09:11:51:00
Last Updated: 2001:01:09:11:51:00