home *** CD-ROM | disk | FTP | other *** search
/ Beijing Paradise BBS Backup / PARADISE.ISO / software / BBSDOORW / ALF20WB.ZIP / ALF.ZIP / ALFCESS.BAT < prev    next >
Encoding:
DOS Batch File  |  1995-11-29  |  1.9 KB  |  61 lines

  1. @echo off
  2. rem
  3. rem    This file extracts a file's extension then calls VIRCHECK.BAT.
  4. rem
  5. rem    Alternately, you can process files right from this batch file using
  6. rem    the supplied variables.
  7. rem
  8. rem        eg.  SCAN %1%2
  9. rem             TOUCH %1%2
  10. rem
  11. rem    IMPORTANT NOTE: It's likely that you'll need to alter your VIRCHECK.BAT
  12. rem    to allow file processing from ANY directory/file area, and not just one
  13. rem    Maximus upload directory that you may have specified. ALF will process
  14. rem    files in ANY directory or drive, so `hard coded' path statements in
  15. rem    VIRCHECK.BAT may not work.
  16. rem
  17. rem    If in doubt, comment out "call vircheck %1 %PRE% %EXT% %4:\MAX\MISC\"
  18. rem    (third last line) until you have time to experiment. :-)
  19. rem
  20. rem    The variables in this batch files are:
  21. rem
  22. rem    %1 Current file area with trailing backslash
  23. rem    %2 File that was imported
  24. rem    %3 Current file area without trailing backslash (WITH trailing
  25. rem       backslash if current file area is Root DIR or Floppy drive)
  26. rem    %4 Drive letter of current drive (upper case)
  27. rem
  28. set cmd=%2+
  29. :loop
  30. set orig=%cmd%
  31. if "%cmd%"=="+" goto out
  32. for %%a in (/%orig%) do if "%%a"=="." goto ext
  33. for %%a in (/%cmd%) do set cmd=%%a
  34. for %%a in (/%orig%) do if %%a%cmd%==%orig% set pre=%pre%%%a
  35. goto loop
  36. :ext
  37. set orig=%cmd%
  38. if "%cmd%"=="+" goto out
  39. for %%a in (/%orig%) do if "%%a"=="+" goto out
  40. for %%a in (/%cmd%) do set cmd=%%a
  41. for %%a in (/%orig%) do if %%a%cmd%==%orig% set ext=%ext%%%a
  42. goto ext
  43. :out
  44. for %%a in (/%cmd%) do set cmd=%%a
  45. for %%a in (/%orig%) do if %%a%cmd%==%orig% set ext=%ext%%%a
  46. set cmd=
  47. set orig=
  48. if (%ext%)==() GOTO NOext
  49. if %ext%==.zip set ext=.ZIP
  50. if %ext%==.arj set ext=.ARJ
  51. if %ext%==.zoo set ext=.ZOO
  52. if %ext%==.lzh set ext=.LZH
  53. if %ext%==.pak set ext=.PAK
  54. if %ext%==.arc set ext=.ARC
  55. if %ext%==.lha set ext=.LHA
  56. if %ext%==.rar set ext=.RAR
  57. :noext
  58. call vircheck %1 %PRE% %EXT% %4:\MAX\MISC\
  59. set pre=
  60. set ext=
  61.