home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
ftp.wwiv.com
/
ftp.wwiv.com.zip
/
ftp.wwiv.com
/
pub
/
EVENTS
/
BRM-UPCK.ZIP
/
BRM-UPCK.BAT
Wrap
DOS Batch File
|
1994-03-19
|
4KB
|
173 lines
Black-Robe Mage #1 @9710
Tue Mar 15 22:59:25 1994
0R: net33: @3113 (via @1021) [07:55 03/19/94]
0R 34 03/19 02:48 WWIVnet 1040->1021
0R: net33: @1040 (via @2050) [00:10 03/18/94]
0R 34 03/17 23:30 WWIVnet ->2050
0R 34 03/16 20:45 WWIVnet 1040->2050
0R: net33: @1040 (via @1042) [20:43 03/16/94]
0R: net33: @1042 (via @9710) [20:14 03/16/94]
0R: net33: @9710 [12:34 03/15/94]
0R: net33: @9710 [00:25 03/16/94]
RE: 4.23 Conversion....
BY: Trickster #1 @5922
I use the following batch files. To scan a file for viruses, I
simply type v <filename>, with or without the extension.
It looks for your header in c:\wwiv\gfiles\header.msg, and only
puts it in if you've had no viruses or errors.
c:\tools should be in your PATH
4c:\tools\v.bat
@echo off
if not exist %1 goto a
call vs %1
goto end
:a
if not exist %1.zip goto b
call vs %1.zip
goto end
:b
if not exist %1.arj goto c
call vs %1.arj
goto end
:c
if not exist %1.lzh goto end
call vs %1.lzh
goto end
:end
4c:\tools\vs.bat
@echo off
deltree /y c:\unzip
echo Scanning for viruses
md c:\unzip
mybe which %1 c:\tools\open.dat
if errorlevel 12 goto copy
if errorlevel 11 goto lzh
if errorlevel 5 goto copy
if errorlevel 4 goto arj
if errorlevel 3 goto zip
:copy
echo Copying file...
copy %1 c:\unzip
goto cont
:lzh
echo Decompressing (lha e %1 c:\unzip\)
lha e %1 c:\unzip\
goto cont
:arj
echo Decompressing (arj e %1 c:\unzip)
arj e %1 c:\unzip
goto cont
:zip
echo Decompressing (pkunzip %1 c:\unzip)
pkunzip %1 c:\unzip
:cont
echo Scanning...
scan c:\unzip /nomem
if errorlevel 2 goto progerror
if errorlevel 1 goto found
echo No viruses found in %1 > c:\wwiv\gfiles\temp.txt
echo No viruses found in %1
mybe which %1 c:\tools\open.dat
if errorlevel 5 goto end
if errorlevel 4 goto harj
if errorlevel 3 goto hzip
goto end
:hzip
echo Done! Changing header.
pkhead %1 c:\wwiv\gfiles\header.msg > nul
goto end
:harj
echo Done! Changing header.
arj c %1 -zc:\wwiv\gfiles\header.msg > nul
goto end
:found
echo %1 has a virus!
echo Virus found in %1 > c:\wwiv\gfiles\temp.txt
goto end
:progerror
echo There has been an error.
echo Error scanning %1 > c:\wwiv\gfiles\temp.txt
:end
echo Updating log.
copy c:\wwiv\gfiles\virus.log+c:\wwiv\gfiles\temp.txt c:\wwiv\gfiles\virus.log > nul
c:
cd \unzip
type c:\wwiv\gfiles\temp.txt
del c:\wwiv\gfiles\temp.txt
4mybe.c
#include <stdio.h>
#include <string.h>
#include <stdlib.h>
int which(char *s1, FILE *f)
{
char *s,ext[5],*ep;
int rval;
if ((s=strchr(strupr(s1),'.')) != NULL) {
s++;
while (!feof(f)) {
ep=ext;
fscanf(f,"%s %d",ep,&rval);
strupr(ep);
if (ep[0]=='.') ep++;
if (!strcmp(s,ep)) return rval;
}
}
return 1;
}
main (int argc, char **argv)
{
int i,val,debug=0;
FILE *f;
if (argc<2) return 0;
if (argv[1][0]=='d' || argv[1][0]=='D') {
debug=1;
argv++;
}
switch(argv[1][0]) {
case 'w':
if ((f=fopen(argv[3],"r"))==NULL) {
fprintf(stderr,"%s not found.",argv[3]);
return 0;
}
val=which(argv[2],f);
fclose(f);
break;
default:
fprintf(stderr,"error: unknown command %c",argv[1][0]);
val=0;
break;
}
if (debug) fprintf(stderr,"ERRORLEVEL %d\n",val);
return val;
}
4c:\tools\open.dat
uue 10
obj 0
bat 5
exe 2
com 2
zip 3
arj 4
gif 6
jpg 6
pcx 6
h 7
c 7
bat 8