Subj : XBOOT3.BTM To : Gerald Miller From : Jasen Betts Date : Sat Nov 02 2002 03:01 pm Hi Gerald. 31-Oct-02 09:01:34, Gerald Miller wrote to Jasen Betts here's what I did to it. *** no changes before here *** :: Next command establishes the location and name of the variable "tempfile" :: that holds the tempfileorary information while the action is performed. set tempfile=%@unique[%temp] :: User input if [%1]==[-?] .or. [%1]==[/?] .or. [%1]==[?] goto USAGE :: Is the file XBOOT3.DAT there? Where? iff not exist %bootfile then echo. color bri red on whi echo ERROR: %@path[%@search[%0]]%@name[%0].DAT not found! color bri cya on bla echo. delay 5 goto END endiff :: Set variables. If XBOOT3 did it's job today already or it's before :: 00:01 am, do nothing. In this case, the "start" time is 00:01 am.... set lastdate=%@date[%@filedate[%bootfile]] set today=%@date[%_date] set dotime=00:01 if %@eval[%lastdate - %today] eq 0 .or. %@eval[%@time[%_time] - %= %@time[%dotime]] le 0 goto END :: Read XBOOT3.DAT, look at which progs to run today, copy info to :: XBOOT3.TMP and update XBOOT3.DAT set i=0 echo. set df=%@replace[2,d,%@replace[20,yy,%@replace[1,m,%@makedate[14936]]]] :: df is local date format. text>%tempfile PATH\PROGRAM TO RUN ³AFTER³ ³ ³DAYS ³ ³ DAYS³LAST RUN³NEXT RUN³ LEFT³ASK endtext echo ÄÄÄÄ 001 %@repeat[Ä,32]ÅÄÄÄÄÄÅ%df%Å%df%ÅÄÄÄÄÄÅÄÄÄ >> %tempfile set df= do n=3 to %@lines[%bootfile] set prog=%@instr[0,41,%@line[%bootfile,%n]] set when=%@instr[42,5,%@line[%bootfile,%n]] set last=%@instr[48,8,%@line[%bootfile,%n]] set next=%@instr[57,8,%@line[%bootfile,%n]] set left=%@instr[66,5,%@line[%bootfile,%n]] set ask=%@instr[72,1,%@line[%bootfile,%n]] iff %@eval[%today-%@date[%last]] ge %when .and. "%prog" ne "" then iff "%ask" eq "Y" then beep 294 2 330 2 277 2 294 2 330 2 277 2 294 2 330 2 277 2 294 2 beep 330 2 0 2 139 2 165 2 196 2 233 2 277 2 466 2 554 2 659 2 beep 784 2 932 2 scrput %_row %@eval[17+%@len[%prog]] bri yel on bla `Y` inkey /c/K"YN[esc][enter]" `Execute `%@upper[%prog]` [Y/N] ?` %%ink echo. iff "%ink" eq "Y" .or. "%ink" eq "@28" then set i=%@inc[%i] set run%i=%prog set last=%@makedate[%today] endiff elseiff "%ask" eq "N" .or. "%ask" eq "" then set i=%@inc[%i] set run%i=%prog set last=%@makedate[%today] endiff elseiff "%prog" == "" then iterate endiff set nextdate=%@eval[%@date[%last]+%when] set daysleft=%@eval[%nextdate - %today] echo %@format[-41.41,%prog]³%@format[-5.5,%when]³%@format[-8.8,%last %= ]³%@makedate[%nextdate]³%@format[-5.5,%daysleft]³%ask>>%tempfile unset /q prog daysleft nextdate enddo unset /q next, move /q/u %tempfile %bootfile >& nul iff "%i" ne "0" then do m=1 to %i echo. %+ echo. color bri whi on whi echos XBOOT3 Program Execution: color bri cya on bla echo %@upper[%[run%m]] echo. call %[run%m] @echo off enddo endiff echo. color bri red on whi echos XBOOT3 END color bri cya on bla echo. :END color bri cya on bla if exist %tempfile del /q %tempfile > nul endlocal color bri cya on bla quit *** no changes after here *** -=> Bye <=- --- * Origin: Optimization hinders evolution. (3:640/531.42) .