Subj : Revisions ... To : All From : Gerald Miller Date : Sun Oct 06 2002 07:13 am Hello All, I've been "playing" with Klaus Meinhard's XBOOTEX.BTM file.... I'll post it here, in its entirety, and then discuss _possible_ suggestions and revisions in a future message. === Cut Begin: XBOOTEX.BTM === :: XBOOTEX.BTM VERSION 1.0 25_Oct_1994 :: (Once a day program upon boot execution) :: :: by Klaus Meinhard :: Brahmsstr. 12 :: G 26842 Ostrhauderfehn :: Germany :: Compuserve 100115,2025 :: :: For those of you who have more extensive needs than can be filled :: by XDAILY.BTM, here is a utility that allows you a very versatile :: handling of programs you want to run only once a day at first boot :: time: :: :: XBOOTEX allows you to specify as many programs as you wish in the :: data file XBOOTEX.DAT, with an interval in days for running each :: program and the possibility to ask if the programm should be run :: (nice if you do not have the time for it just then). You will be :: asked again the next day if you skip. :: :: If you want to run another batch file, enter `CALL :: c:\path\mybatch` in XBOOTEX.DAT to insure the return to :: XBOOTEX.BTM after execution. :: :: So maybe you want to run STACKER's CHECK every day, but a virus :: scanner only once a week, and defrag once a month? No problem, :: just fill in those progs in XBOOTEX.DAT with the appropriate :: parameters. Just be careful not to change the formatting of that :: file, because XBOOTEX.BTM depends on it. :: :: There is an example file XBOOTEX.DAT which shows the working of :: all this and does only harmless things like dir, tree, and XDOSDEV :: to show you how XBOOTEX works. :: :: Call XBOOTEX.BTM from your autoexec.bat. XBOOTEX.DAT _must_ be in :: your path or the root dir of your boot drive! :: :: Further suggestions welcome :START *setlocal *unalias * on break goto END set _oldfg=%_fg set _oldbg=%_bg if "%temp" eq "" set temp=C:\ set _bootfile=%@path[%@search[%0]]%@name[%0].DAT :: User input if [%1]==[-?] .or. [%1]==[/?] .or. [%1]==[?] goto USAGE :: Is the file XBOOTEX.DAT there? Where? iff not exist %_bootfile then echo. echo ERROR: %@path[%@search[%0]]%@name[%0].DAT not found! echo. goto END endiff :: Set variables. If XBOOTEX did it's job today already or it's :: before 06:00 am, do nothing. set _lastdate=%@date[%@filedate[%_bootfile]] set _today=%@date[%_date] set _dotime=06:00 if %@eval[%_lastdate - %_today] eq 0 .or. %@eval[%@time[%_time] %= - %@time[%_dotime]] le 0 goto END :: Read XBOOTEX.DAT, look at which progs to run today, copy info to :: XBOOTEX.TMP and update XBOOTEX.DAT set i=0 echo. echo %@line[%_bootfile,0] > %temp\XBOOTEX.TMP echo %@line[%_bootfile,1] >> %temp\XBOOTEX.TMP do n=2 to %@lines[%_bootfile] set _prog=%@instr[0,39,%@line[%_bootfile,%n]] set _when=%@instr[40,14,%@line[%_bootfile,%n]] set _last=%@instr[55,8,%@line[%_bootfile,%n]] set _ask=%@instr[64,1,%@line[%_bootfile,%n]] iff %@eval[%_today-%@date[%_last]] ge %_when .and. "%_prog" %= ne "" then iff "%_ask" eq "Y" then beep scrput %_row %@eval[17+%@len[%_prog]] bri yel on %_oldbg `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 echo %@format[-39.39,%_prog]³%@format[-14.14,%_when]³%= %@makedate[%_today]³%_ask >> %temp\XBOOTEX.TMP else echo %@format[-39.39,%_prog]³%@format[-14.14,%_when]³%= %_last³%_ask >> %temp\XBOOTEX.TMP endiff endiff iff "%_ask" eq "N" .or. "%_ask" eq "" then set i=%@inc[%i] set _run%i=%_prog echo %@format[-39.39,%_prog]³%@format[-14.14,%_when]³%= %@makedate[%_today]³%_ask >> %temp\XBOOTEX.TMP endiff elseiff "%_prog" ne "" then echo %@format[-39.39,%_prog]³%@format[-14.14,%_when]³%= %_last³%_ask >> %temp\XBOOTEX.TMP endiff unset /q _prog enddo move /q/u %temp\XBOOTEX.TMP %_bootfile >& nul iff "%i" ne "0" then do m=1 to %i echo. echo. color bri whi on whi echos XBOOTEX Programm Execution: color %_oldfg on %_oldbg echo %@upper[%[_run%m]] echo. %[_run%m] @echo off enddo endiff echo. color bri whi on whi echos XBOOTEX END color %_oldfg on %_oldbg echo. :END color %_oldfg on %_oldbg if exist %temp\XBOOTEX.TMP del /q %temp\XBOOTEX.TMP > nul quit :USAGE text +------------------------------------------------------------------------+ | XBOOTEX ------- Once a day programm execution with many options | | (selectable intervals, ask before execution). | | For more info see the header of this file. | | | | XBOOTEX.DAT is the data file XBOOTEX.BTM, where | | you can enter your progs and parameters. It | | _must_ be in your path or the root dir of your | | boot drive. | | | | XBOOTEX should be _called_ from autoexec.bat | | | | Syntax: XBOOTEX /? -? Syntax (this screen) | +------------------------------------------------------------------------+ endtext goto END === Cut End: XBOOTEX.BTM === === Cut Begin: XBOOTEX.DAT === PATH\PROGRAMM TO RUN |AFTER DAYS |LAST RUN|ASK ---------------------------------------+--------------+--------+--- c:\windows\remind.btm |1 |15.09.96|N call c:\btm\cortime.btm /s |1 |25.09.96|Y === Cut End: XBOOTEX.DAT === Cheers ... Gerald --- GoldED+/386 version-1.1.5 snapshot-2002.9.29 * Origin: Finding fault is easy. Fixing faults can be tough. (1:342/512) .