home *** CD-ROM | disk | FTP | other *** search
- @echo off
- text
-
- --------------------------------------------------------
- NEWFILE-MANAGER V5.0a/0916 - (c) 1996 BY THOMAS MORPER
- --------------------------------------------------------
-
- endtext
-
- rem -----------------------------------------------------------------
- rem NFM_WORK : Where to unpack files to
- rem NFM_STOR : Where to store the repacked files
- rem NFM_SCAN : How to start the virus-scanner
- rem NFM_COPY : Where to store unpacked files (if you want to do so)
- rem -----------------------------------------------------------------
- set nfm_work=c:\$new$
- set nfm_stor=c:\repack
- set nfm_scan=c:\fprot\f-prot %nfm_work% /noboot /nomem /silent
- set nfm_copy=c:\newfiles
-
- set nfm_cdad=%_cwd%
- if not "%1"=="" cdd %1
- for %i1 in (*.*) do gosub proceed
- goto end
-
- :proceed
- set nfm_stat=-
- set nfm_unpa=-
- rem ------------------------------------------------------------------
- rem Archive-type is detected via the file-extension (zip,...)
- rem NFM_UNPA is the command to unpack files to the working directory
- rem You can add other archivers if they work like these
- rem ------------------------------------------------------------------
- iff "%@ext[%i1]"=="arj" then set nfm_unpa=arj x -y %i1 %nfm_work% ^ endiff
- iff "%@ext[%i1]"=="lzh" then set nfm_unpa=lha x %i1 %nfm_work%\ ^ endiff
- iff "%@ext[%i1]"=="rar" then set nfm_unpa=rar x -y %i1 %nfm_work% ^ endiff
- iff "%@ext[%i1]"=="zip" then set nfm_unpa=pkunzip -d %i1 %nfm_work% ^ endiff
- if "%nfm_unpa%"=="-" return
- if isdir %nfm_work% del /qsxyz %nfm_work%
- md %nfm_work%
- %nfm_unpa%
- rem ------------------------------------------------------------------
- rem Uncomment the 'gosub killtrash' if you want to kill BBS-Ads etc.
- rem ------------------------------------------------------------------
- rem gosub killtrash
- %nfm_scan%
- if errorlevel 1 gosub infected
- rem ----------------------------------------------------------------
- rem Just enable the archiver you wish to use or add others.
- rem Attention! Since I usually do not use anything else than ZIP
- rem the other given command-lines might not excactly work the way
- rem they should do. However you can change parameters as you like,
- rem you only have to keep the '%nfm...' statements
- rem ----------------------------------------------------------------
- rem arj a -e1 -s %nfm_stor%\%@name[%i1] %nfm_work%\*.*
- rem lha a -r %nfm_stor%\%@name[%i1] %nfm_work%\*.*
- pkzip -o -rp %nfm_stor%\%@name[%i1] %nfm_work%\*.*
- rem rar a -ep1 -r -tk %nfm_stor%\%@name[%i1] %nfm_work%\*.*
- iff "%nfm_stat%"=="i" then
- describe %nfm_stor%\%@name[%i1].zip "*** ARCHIVE MAY CONTAIN A VIRUS! ***"
- rename %nfm_stor%\%@name[%i1].* %@name[%i1].vir
- else
- describe %nfm_stor%\%@name[%i1].zip "%@descript[%i1]"
- endiff
- iff "%nfm_copy%"=="" then
- if isdir %nfm_work% del /qsxyz %nfm_work%
- else
- md %nfm_copy%\%@name[%i1]
- move %nfm_work%\*.* %nfm_copy%\%@name[%i1] /qs
- if isdir %nfm_work% del /qsxyz %nfm_work%
- endiff
- return
-
- :infected
- rem ----------------------------------------------------------------------
- rem Put "SET COLORDIR=VIR:BRI BLI RED" into your AUTOEXEC.BAT to see the
- rem .VIR-files in flashing red when having a look into the directory
- rem ----------------------------------------------------------------------
- echo WARNING! %@upper[%i1] MAY BE INFECTED! - RENAMING TO %@upper[%@name[%i1]].VIR
- beep 440 3 349 3
- delay 3
- set nfm_stat=i
- return
-
- :killtrash
- rem -------------------------------------------------------------------
- rem Kill all anoying bbs-adverts by giving filename, size and a short
- rem description (w/o spaces!) in lines like these:
- rem -------------------------------------------------------------------
- set nfm_kill=boooring.bbs 12345 Boring_BBS_advert ^ gosub killsub
- set nfm_kill=kill_me!.xyz 9876 kill_those_9876_bytes ^ gosub killsub
- return
-
- :killsub
- iff exist %nfm_work%\%@word[0,%nfm_kill%] .and. %@filesize[%nfm_work%\%@word[0,%nfm_kill%],b]==%@word[1,%nfm_kill%] then
- del /q %nfm_work%\%@word[0,%nfm_kill%]
- echo Killed %@upper[%@word[0,%nfm_kill%]] in Archive %@upper[%i1] : %@word[2,%nfm_kill%]
- beep
- endiff
- return
-
- :end
- cdd %nfm_cdad%
- unset nfm_cdad nfm_scan nfm_stat nfm_stor nfm_unpa nfm_work
- if "%nfm_copy%"!="" unset nfm_copy
- if "%nfm_kill%"!="" unset nfm_kill
- echo DONE!
- echo.
-