/* $VER: CheckFiles.vzrx 1.00 (28.2.98) © 1998 by Georg Hörmann Idea by Ramiro Garcia Template: CheckFiles.vzrx FILE1/A,FILE2/K,FILE3/K,...,QUIT/S FILE1, FILE2, FILE3, etc.: Must be one or more valid filenames (with path). QUIT: If VirusZ has been started from the script, you can quit after checking by specifying this option. If VirusZ is not running, it will be started from the script (and quitted afterwards if requested). */ Prog_VirusZ = "dh0:VZ" /* You may change this */ options results options failat 99 UseQuitFlag = "no" parse upper arg list if list = "" then do say "No files specified." exit end k=0 /* Break up the argument into a list of files */ DO UNTIL list = "" PARSE VAR list kthword.k list k=k+1 END if ~show(ports,VIRUSZ_II.REXX) then do say "Starting VirusZ..." address command Prog_VirusZ UseQuitFlag = "yes" StartTime = time(seconds) do while ~show(ports,VIRUSZ_II.REXX) if time(seconds) - StartTime > 20 then do say "Error loading VirusZ!" exit end end end Q=k-1 /* Check for presence of QuitFlag */ QuitFlag = kthword.Q if QuitFlag = "QUIT" then COUNTER = k-2; else COUNTER = k-1 DO n=0 to COUNTER /* Check the files vor viruses */ address VIRUSZ_II.REXX CHECKFILE kthword.n DECREXEC DECRDATA if rc=0 then say "File '"kthword.n"' is clean." if rc=5 then say "File '"kthword.n"' contains virus!" if rc=10 then say "Error checking file '"kthword.n"'!" END if UseQuitFlag = "yes" then do if QuitFlag = "QUIT" then do say "Quitting VirusZ..." address VIRUSZ_II.REXX QUIT end end