home *** CD-ROM | disk | FTP | other *** search
- @echo off
- rem
- rem This file extracts a file's extension then calls VIRCHECK.BAT.
- rem
- rem Alternately, you can process files right from this batch file using
- rem the supplied variables.
- rem
- rem eg. SCAN %1%2
- rem TOUCH %1%2
- rem
- rem IMPORTANT NOTE: It's likely that you'll need to alter your VIRCHECK.BAT
- rem to allow file processing from ANY directory/file area, and not just one
- rem Maximus upload directory that you may have specified. ALF will process
- rem files in ANY directory or drive, so `hard coded' path statements in
- rem VIRCHECK.BAT may not work.
- rem
- rem If in doubt, comment out "call vircheck %1 %PRE% %EXT% %4:\MAX\MISC\"
- rem (third last line) until you have time to experiment. :-)
- rem
- rem The variables in this batch files are:
- rem
- rem %1 Current file area with trailing backslash
- rem %2 File that was imported
- rem %3 Current file area without trailing backslash (WITH trailing
- rem backslash if current file area is Root DIR or Floppy drive)
- rem %4 Drive letter of current drive (upper case)
- rem
- set cmd=%2+
- :loop
- set orig=%cmd%
- if "%cmd%"=="+" goto out
- for %%a in (/%orig%) do if "%%a"=="." goto ext
- for %%a in (/%cmd%) do set cmd=%%a
- for %%a in (/%orig%) do if %%a%cmd%==%orig% set pre=%pre%%%a
- goto loop
- :ext
- set orig=%cmd%
- if "%cmd%"=="+" goto out
- for %%a in (/%orig%) do if "%%a"=="+" goto out
- for %%a in (/%cmd%) do set cmd=%%a
- for %%a in (/%orig%) do if %%a%cmd%==%orig% set ext=%ext%%%a
- goto ext
- :out
- for %%a in (/%cmd%) do set cmd=%%a
- for %%a in (/%orig%) do if %%a%cmd%==%orig% set ext=%ext%%%a
- set cmd=
- set orig=
- if (%ext%)==() GOTO NOext
- if %ext%==.zip set ext=.ZIP
- if %ext%==.arj set ext=.ARJ
- if %ext%==.zoo set ext=.ZOO
- if %ext%==.lzh set ext=.LZH
- if %ext%==.pak set ext=.PAK
- if %ext%==.arc set ext=.ARC
- if %ext%==.lha set ext=.LHA
- if %ext%==.rar set ext=.RAR
- :noext
- call vircheck %1 %PRE% %EXT% %4:\MAX\MISC\
- set pre=
- set ext=
-