@echo off
rem  ΙΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ»
rem  Ί              DLCHECK.BAT              Ί
rem  Ί  Copyright (c) 1990 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_files

cls
echo DLCHECK  Copyright (c) 1990 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_files
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_files\dl1$$$

rem handle first-level archived files

cd \new_files\dl1$$$

if exist \new_files\*.zip pkunzip \new_files\*.zip
if exist \new_files\*.zip echo ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ

if exist \new_files\*.arc pkunpak \new_files\*.arc
if exist \new_files\*.arc echo ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ

if exist \new_files\*.lzh lharc e \new_files\*.lzh
if exist \new_files\*.lzh echo ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ

if exist \new_files\*.pak copy \new_files\*.pak
if exist \new_files\*.pak pak e *.pak
if exist \new_files\*.pak echo ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ

if exist \new_files\*.zoo copy \new_files\*.zoo
if exist \new_files\*.zoo looz x *.zoo
if exist \new_files\*.zoo echo ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ

cd \new_files

rem scan for viruses

scan \new_files\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_files\dl1$$$\*.zip set dl2=1
if exist \new_files\dl1$$$\*.arc set dl2=1
if exist \new_files\dl1$$$\*.lzh set dl2=1
if exist \new_files\dl1$$$\*.pak set dl2=1

if %dl2%==-1 goto messages

rem create subdirectory for testing of nested archives

md \new_files\dl1$$$\dl2$$$

rem handle nested archives

cd \new_files\dl1$$$\dl2$$$

if exist \new_files\dl1$$$\*.zip pkunzip \new_files\dl1$$$\*.zip
if exist \new_files\dl1$$$\*.zip echo ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ

if exist \new_files\dl1$$$\*.arc pkunpak \new_files\dl1$$$\*.arc
if exist \new_files\dl1$$$\*.arc echo ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ

if exist \new_files\dl1$$$\*.lzh lharc e \new_files\dl1$$$\*.lzh
if exist \new_files\dl1$$$\*.lzh echo ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ

if exist \new_files\dl1$$$\*.pak copy \new_files\dl1$$$\*.pak
if exist \new_files\dl1$$$\*.pak pak e *.pak
if exist \new_files\dl1$$$\*.pak echo ΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝΝ

cd \new_files

rem test for viruses in nested archives

scan \new_files\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_files\dl1$$$\dl2$$$\*.zip set dl3=1
if exist \new_files\dl1$$$\dl2$$$\*.arc set dl3=1
if exist \new_files\dl1$$$\dl2$$$\*.lzh set dl3=1
if exist \new_files\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_files\dl1$$$\dl2$$$

if %dl2%==-1 goto continue
echo y|del \new_files\dl1$$$\dl2$$$\*.* >nul
rd \new_files\dl1$$$\dl2$$$

:continue

rem delete and remove \new_files\dl1$$$

if %dl1%==-1 goto end
echo y|del \new_files\dl1$$$\*.* >nul
rd \new_files\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
errlv-2
goto enda

:set1
errlv-1

:enda

for %%e in (dlx dl1 dl2 dl3) do set %%e=
