home *** CD-ROM | disk | FTP | other *** search
- @echo off
- rem ╔════════════════════════════════════════════╗
- rem ║ DLCHECK.BAT ║
- rem ║ Copyright (c) 1990, 1991 by Duane Paulson ║
- rem ║ See DLCHECK.DOC for further information ║
- rem ╚════════════════════════════════════════════╝
-
- for %%a in (dlx dl1 dl2) do set %%a=-1
- set dl3=0
-
- cd\new_file
-
- cls
- echo DLCHECK Version 1.1 Copyright (c) 1990, 1991 by Duane Paulson
- echo ══════════════════════════════════════════════════════════════════════════════
-
- rem test for executable files
-
- for %%a in (EXE COM BIN SYS) do if exist *.%%a set dlx=1
-
- rem test executable files
-
- if %dlx%==1 scan \new_file
- if %dlx%==1 echo ══════════════════════════════════════════════════════════════════════════════
-
- if %dlx%==-1 goto noexe
-
- rem interpret exit code from SCAN.EXE
-
- if errorlevel 0 if not errorlevel 1 set dlx=0
- if errorlevel 1 if not errorlevel 2 set dlx=1
- if errorlevel 2 set dlx=2
-
- :noexe
-
- rem test for archived files
-
- if exist *.zip set dl1=1
- if exist *.arc set dl1=1
- if exist *.lzh set dl1=1
- if exist *.pak set dl1=1
- if exist *.zoo set dl1=1
-
- if %dl1%==-1 goto label1
- goto next
-
- :label1
- echo DLCHECK:
- echo No Archived Files Found
-
- if not %dlx%==-1 goto exemessage
- goto end
-
- :next
-
- rem create first-level subdirectory
-
- md \new_file\dl1$$$
-
- rem handle first-level archived files
-
- cd \new_file\dl1$$$
-
- if exist \new_file\*.zip pkunzip \new_file\*.zip
- if exist \new_file\*.zip echo ══════════════════════════════════════════════════════════════════════════════
-
- if exist \new_file\*.arc pkunpak \new_file\*.arc
- if exist \new_file\*.arc echo ══════════════════════════════════════════════════════════════════════════════
-
- if exist \new_file\*.lzh lharc e \new_file\*.lzh
- if exist \new_file\*.lzh echo ══════════════════════════════════════════════════════════════════════════════
-
- if exist \new_file\*.pak copy \new_file\*.pak
- if exist \new_file\*.pak pak e *.pak
- if exist \new_file\*.pak echo ══════════════════════════════════════════════════════════════════════════════
-
- if exist \new_file\*.zoo copy \new_file\*.zoo
- if exist \new_file\*.zoo looz x *.zoo
- if exist \new_file\*.zoo echo ══════════════════════════════════════════════════════════════════════════════
-
- cd \new_file
-
- rem scan for viruses
-
- scan \new_file\dl1$$$
- echo ══════════════════════════════════════════════════════════════════════════════
-
- rem interpret exit code from SCAN
-
- if errorlevel 0 if not errorlevel 1 set dl1=0
- if errorlevel 1 if not errorlevel 2 set dl1=1
- if errorlevel 2 set dl1=2
-
- rem check for nested archives
-
- if exist \new_file\dl1$$$\*.zip set dl2=1
- if exist \new_file\dl1$$$\*.arc set dl2=1
- if exist \new_file\dl1$$$\*.lzh set dl2=1
- if exist \new_file\dl1$$$\*.pak set dl2=1
-
- if %dl2%==-1 goto messages
-
- rem create subdirectory for testing of nested archives
-
- md \new_file\dl1$$$\dl2$$$
-
- rem handle nested archives
-
- cd \new_file\dl1$$$\dl2$$$
-
- if exist \new_file\dl1$$$\*.zip pkunzip \new_file\dl1$$$\*.zip
- if exist \new_file\dl1$$$\*.zip echo ══════════════════════════════════════════════════════════════════════════════
-
- if exist \new_file\dl1$$$\*.arc pkunpak \new_file\dl1$$$\*.arc
- if exist \new_file\dl1$$$\*.arc echo ══════════════════════════════════════════════════════════════════════════════
-
- if exist \new_file\dl1$$$\*.lzh lharc e \new_file\dl1$$$\*.lzh
- if exist \new_file\dl1$$$\*.lzh echo ══════════════════════════════════════════════════════════════════════════════
-
- if exist \new_file\dl1$$$\*.pak copy \new_file\dl1$$$\*.pak
- if exist \new_file\dl1$$$\*.pak pak e *.pak
- if exist \new_file\dl1$$$\*.pak echo ══════════════════════════════════════════════════════════════════════════════
-
- cd \new_file
-
- rem test for viruses in nested archives
-
- scan \new_file\dl1$$$\dl2$$$ /nomem
-
- rem interpret exit code from scan
-
- if errorlevel 0 if not errorlevel 1 set dl2=0
- if errorlevel 1 if not errorlevel 2 set dl2=1
- if errorlevel 2 set dl=2
-
- rem test for third-level archives
-
- if exist \new_file\dl1$$$\dl2$$$\*.zip set dl3=1
- if exist \new_file\dl1$$$\dl2$$$\*.arc set dl3=1
- if exist \new_file\dl1$$$\dl2$$$\*.lzh set dl3=1
- if exist \new_file\dl1$$$\dl2$$$\*.pak set dl3=1
-
- :messages
-
- echo ══════════════════════════════════════════════════════════════════════════════
- echo DLCHECK:
-
- :exemessage
-
- rem display message if .exe or .com files were found and scanned in the d/l
-
- if %dlx%==0 echo Take Note: Executable files were found in this download.
- if %dlx%==0 echo Further testing may be indicated if these files contain archived material.
- if %dlx%==0 echo\
- if %dlx%==1 echo Warning!!! SCAN.EXE indicates Virus infection in an unarchived file!!!
- if %dlx%==2 echo Warning!!! SCAN.EXE terminated abnormally while checking
- if %dlx%==2 echo an unarchived file! Use Caution!
-
- rem display message for result of primary-level scan
-
- if %dl1%==0 echo Primary Archives check out OK
- if %dl1%==1 echo Warning!!! SCAN.EXE indicates Virus infection in a Primary Archive file!!!!
- if %dl1%==2 echo Warning!!! SCAN.EXE terminated abnormally on Primary Level Scan!
- if %dl1%==2 echo Proceed With Caution!!!!
-
- rem display message for result of nested-level scan
-
- if %dl2%==0 echo Nested Archives check out OK
- if %dl2%==1 echo Warning!!! SCAN.EXE indicates Virus infection in a Nested Archive!!!!
- if %dl2%==2 echo Warning!!! SCAN.EXE terminated abnormally on Nested Level Scan!
- if %dl2%==2 echo Proceed With Caution!!!!
-
- rem display message if third-level file is found
-
- if %dl3%==1 echo Take Note: Archives nested to the third level found.
- if %dl3%==1 echo No Scan was performed on 3rd level or greater archive file(s).
- if %dl3%==1 echo\
-
- rem delete and remove \new_file\dl1$$$\dl2$$$
-
- if %dl2%==-1 goto continue
- echo Press 'Y' to delete temporary files. Does not affect you original files.
- echo on
- del \new_file\dl1$$$\dl2$$$\*.*
- @echo off
- echo Removing temporary subdirectory \new_file\dl1$$$\dl2$$$
- rd \new_file\dl1$$$\dl2$$$
-
- :continue
-
- rem delete and remove \new_file\dl1$$$
-
- if %dl1%==-1 goto end
- echo Press 'Y' to delete temporary files. Does not affect you original files.
- echo on
- del \new_file\dl1$$$\*.*
- @echo off
- echo Removing temporary subdirectory \new_file\dl1$$$
- rd \new_file\dl1$$$
-
- :end
-
- rem check and set errorlevel
-
- if %dlx%==-1 goto lbl1
- if %dlx%==0 goto lbl1
- if %dlx%==1 goto set1
- if %dlx%==2 goto lbl3
-
- :lbl1
- if %dl1%==-1 goto lbl2
- if %dl1%==0 goto lbl2
- if %dl1%==1 goto set1
- if %dl1%==2 goto lbl3
-
- :lbl2
- if %dl2%==-1 goto enda
- if %dl2%==0 goto enda
- if %dl2%==1 goto set1
- if %dl2%==2 goto lbl3
-
- :lbl3
- if %dlx%==1 goto set1
- if %dl1%==1 goto set1
- if %dl2%==1 goto set1
- seterr 2
- goto enda
-
- :set1
- seterr 1
-
- :enda
-
- for %%e in (dlx dl1 dl2 dl3) do set %%e=