home *** CD-ROM | disk | FTP | other *** search
/ PC Online 1997 January / PCO0197.ISO / filesbbs / dos / nfm.arj / NFM50A.BTM < prev   
Encoding:
Text File  |  1996-09-16  |  4.3 KB  |  109 lines

  1. @echo off
  2. text
  3.  
  4.             --------------------------------------------------------
  5.              NEWFILE-MANAGER V5.0a/0916 - (c) 1996 BY THOMAS MORPER
  6.             --------------------------------------------------------
  7.  
  8. endtext
  9.  
  10. rem -----------------------------------------------------------------
  11. rem  NFM_WORK : Where to unpack files to
  12. rem  NFM_STOR : Where to store the repacked files
  13. rem  NFM_SCAN : How to start the virus-scanner
  14. rem  NFM_COPY : Where to store unpacked files (if you want to do so)
  15. rem -----------------------------------------------------------------
  16. set nfm_work=c:\$new$
  17. set nfm_stor=c:\repack
  18. set nfm_scan=c:\fprot\f-prot %nfm_work% /noboot /nomem /silent
  19. set nfm_copy=c:\newfiles
  20.  
  21. set nfm_cdad=%_cwd%
  22. if not "%1"=="" cdd %1
  23. for %i1 in (*.*) do gosub proceed
  24. goto end
  25.  
  26. :proceed
  27. set nfm_stat=-
  28. set nfm_unpa=-
  29. rem ------------------------------------------------------------------
  30. rem  Archive-type is detected via the file-extension (zip,...)
  31. rem  NFM_UNPA is the command to unpack files to the working directory
  32. rem  You can add other archivers if they work like these
  33. rem ------------------------------------------------------------------
  34. iff "%@ext[%i1]"=="arj" then set nfm_unpa=arj x -y %i1 %nfm_work%    ^ endiff
  35. iff "%@ext[%i1]"=="lzh" then set nfm_unpa=lha x %i1 %nfm_work%\      ^ endiff
  36. iff "%@ext[%i1]"=="rar" then set nfm_unpa=rar x -y %i1 %nfm_work%    ^ endiff
  37. iff "%@ext[%i1]"=="zip" then set nfm_unpa=pkunzip -d %i1 %nfm_work%  ^ endiff
  38. if "%nfm_unpa%"=="-" return
  39. if isdir %nfm_work% del /qsxyz %nfm_work%
  40. md %nfm_work%
  41. %nfm_unpa%
  42. rem ------------------------------------------------------------------
  43. rem  Uncomment the 'gosub killtrash' if you want to kill BBS-Ads etc.
  44. rem ------------------------------------------------------------------
  45. rem gosub killtrash
  46. %nfm_scan%
  47. if errorlevel 1 gosub infected
  48. rem ----------------------------------------------------------------
  49. rem  Just enable the archiver you wish to use or add others.
  50. rem  Attention! Since I usually do not use anything else than ZIP
  51. rem  the other given command-lines might not excactly work the way
  52. rem  they should do. However you can change parameters as you like,
  53. rem  you only have to keep the '%nfm...' statements
  54. rem ----------------------------------------------------------------
  55. rem arj a -e1 -s      %nfm_stor%\%@name[%i1] %nfm_work%\*.*
  56. rem lha a -r          %nfm_stor%\%@name[%i1] %nfm_work%\*.*
  57.     pkzip -o -rp      %nfm_stor%\%@name[%i1] %nfm_work%\*.*
  58. rem rar a -ep1 -r -tk %nfm_stor%\%@name[%i1] %nfm_work%\*.*
  59. iff "%nfm_stat%"=="i" then
  60.   describe %nfm_stor%\%@name[%i1].zip "*** ARCHIVE MAY CONTAIN A VIRUS! ***"
  61.   rename %nfm_stor%\%@name[%i1].* %@name[%i1].vir
  62. else
  63.   describe %nfm_stor%\%@name[%i1].zip "%@descript[%i1]"
  64. endiff
  65. iff "%nfm_copy%"=="" then
  66.   if isdir %nfm_work% del /qsxyz %nfm_work%
  67. else
  68.   md %nfm_copy%\%@name[%i1]
  69.   move %nfm_work%\*.* %nfm_copy%\%@name[%i1] /qs
  70.   if isdir %nfm_work% del /qsxyz %nfm_work%
  71. endiff
  72. return
  73.  
  74. :infected
  75. rem ----------------------------------------------------------------------
  76. rem  Put "SET COLORDIR=VIR:BRI BLI RED" into your AUTOEXEC.BAT to see the
  77. rem  .VIR-files in flashing red when having a look into the directory
  78. rem ----------------------------------------------------------------------
  79. echo WARNING! %@upper[%i1] MAY BE INFECTED! - RENAMING TO %@upper[%@name[%i1]].VIR
  80. beep 440 3 349 3
  81. delay 3
  82. set nfm_stat=i
  83. return
  84.  
  85. :killtrash
  86. rem -------------------------------------------------------------------
  87. rem  Kill all anoying bbs-adverts by giving filename, size and a short
  88. rem  description (w/o spaces!) in lines like these:
  89. rem -------------------------------------------------------------------
  90. set nfm_kill=boooring.bbs  12345 Boring_BBS_advert            ^ gosub killsub
  91. set nfm_kill=kill_me!.xyz   9876 kill_those_9876_bytes        ^ gosub killsub
  92. return
  93.  
  94. :killsub
  95. iff exist %nfm_work%\%@word[0,%nfm_kill%] .and. %@filesize[%nfm_work%\%@word[0,%nfm_kill%],b]==%@word[1,%nfm_kill%] then
  96.   del /q %nfm_work%\%@word[0,%nfm_kill%]
  97.   echo Killed %@upper[%@word[0,%nfm_kill%]] in Archive %@upper[%i1] : %@word[2,%nfm_kill%]
  98.   beep
  99. endiff
  100. return
  101.  
  102. :end
  103. cdd %nfm_cdad%
  104. unset nfm_cdad nfm_scan nfm_stat nfm_stor nfm_unpa nfm_work
  105. if "%nfm_copy%"!="" unset nfm_copy
  106. if "%nfm_kill%"!="" unset nfm_kill
  107. echo DONE!
  108. echo.
  109.