 ͻ
  These batch files and concepts are intended to run McAfee's SCAN v2.x  
  check for VSHIELD and echo any error messages back to the users screen  
  as well as log the errors for diagnostic purposes by the ADMIN         
       THESE ARE ONLY SAMPLES FEEL FREE TO MODIFY ACCORDINGLY            
      PLEASE NOTE THEY MAY NOT WORK IN ALL NETWORK ENVIRONMENTS          
   Written by: DJ Tech @ McAfee Technical Support - June 1995            
 ͼ


Batch files for utilizing McAfee's SCAN and Vshield on networks. 


Step 1:
LOGIN to server as SUPERVISOR or equivalant
	F:\> LOGIN server_name/SUPERVISOR

Step 2:
GOTO STEP 3

Step 3.
The following lines must be added to the system login script
The first line just sets a user variable which will be utilized
in the MCAFEE.BAT and CHK4VSH.BAT file for identifying the user 
which is running the batch files during login.
	ADD TO SYSTEM LOGIN SCRIPT:
	---------------------------
	
	SET USER_ID="%USER_ID"                  <---- Sets DOS variable to the user's id number
	SET LOG_NAME="%LOGIN_NAME"              <---- Sets DOS variable to the user's login name
	
	MAP ROOT K: = SYS:HOME\%LOGIN_NAME      <---- Map roots to users home directory
	MAP ROOT Q: = SYS:APPS\
	MAP INS ROOT S1: = SYS:PUBLIC
	DRIVE K:

	;REM NEXT SECTION ADDED BY MCAFEE PSET FOR VIRUSSCAN
	IF MEMBER OF "SCAN" THEN
		MAP X:=SYS:MCAFEE\               <---- Maps drive to MCAFEE directory
		IF "%<SCAN>" != "YES" THEN       <---- Tests DOS SET Variable if NOT equal to YES
			EXIT "X:MCAFEE.BAT"      <---- If above line is true exits to batch file
		ELSE 
			MAP DEL X:               <---- Else deletes drive mapping to MCAFEE
		END
	END
	IF MEMBER OF "SCANTSR" THEN
		MAP X:=SYS:MCAFEE\               <---- Maps drive to MCAFEE directory
		IF "%<SCANTSR>"!="YES" THEN      <---- Tests DOS SET Variable if NOT equal to YES
			EXIT "X:CHK4VSH.BAT"     <---- If above line is true exits to batch file
		ELSE
			MAP DEL X:               <---- Else deletes drive mapping to MCAFEE
		END
	END
	;REM END OF MCAFEE SECTION OF LOGIN SCRIPT
	

Step 4.
Create a MCAFEE directory on the SYS volume of the server.
	SYS:\> MD\MCAFEE
	Users will need READ and FILESCAN rights
	SYS:\> MD\MCAFEE\VIRUSLOG
	Users will need READ, WRITE, CREATE, & MODIFY rights

Step 5.
Files that must be copied to the SYS:\MCAFEE directory:
	SCAN.EXE
	SCAN.DAT
	CLEAN.DAT - (optional)
	NAMES.DAT
	CHKVSHLD.EXE
	MCAFEE.BAT
	CHK4VSH.BAT
	PKUNZIP.EXE - (optional)

Step 6.
Now the files should all be in place.  The LOGIN script is going to check 
to see if the user is a member of the group called SCAN.
If indeed the user is a member of the group it will then check for a DOS
variable called SCAN.  If the SET SCAN=YES, this means the user has already
been scanned once since they turned on their computer and thus skips scanning
them again.  If SET SCAN NOT EQUAL TO YES then the login script will exit to
a batch file called MCAFEE.BAT, at this time the user will be execute a batch
file similar to the following:
	MCAFEE.BAT
	----------
	@echo off
	REM ͻ
	REM  This batch file is intended to run McAfee's SCAN v2.x and echo any 
	REM  error messages back to the users screen for diagnostic purposes    
	REM  Written by: DJ TECH @ McAfee PSET - June  1995                     
	REM ͼ
	rem DEL k:\bugfix.ok
	CLS
	echo ͻ
	echo                         **  ATTENTION  **                           
	echo          Scanning your local drives before allowing login!          
	echo           Written by: DJ TECH @ McAfee PSET  - June  1995           
	echo ͼ
	echo .
	REM SCAN C:\ WILL JUST SCAN MBR AND ROOT DIRECTORY FOR VIRUSES
	REM SCAN /ADL /NOBREAK WILL SCAN MBR AND WHOLE HARD DRIVE FOR VIRUSES
	REM SCAN /ADL /NOBREAK
	REM SCAN C:\ /ALL /PAUSE /REPORT k:lastscan.rpt /frequency 4 
	O:\SCAN C: /NOBREAK /PAUSE /report k:lastscan.rpt /frequency 96 <------- The O: drive can be changed however is used in this example.                                                     
	REM O:SCAN C:\ /NOBREAK /ALL /PAUSE /report k:lastscan.rpt 
	if errorlevel 21 goto error21
	if errorlevel 20 goto error20
	if errorlevel 18 goto error18
	if errorlevel 17 goto error17
	if errorlevel 16 goto error16
	if errorlevel 15 goto error15
	if errorlevel 14 goto error14
	if errorlevel 13 goto error13
	if errorlevel 12 goto error12
	if errorlevel 11 goto error11
	if errorlevel 10 goto error10
	if errorlevel 9 goto error9
	if errorlevel 8 goto error8
	if errorlevel 7 goto error7
	if errorlevel 6 goto error6
	if errorlevel 5 goto error5
	if errorlevel 4 goto error4
	if errorlevel 3 goto error3
	if errorlevel 2 goto error2
	if errorlevel 1 goto error1
	if errorlevel 0 goto error0
	goto end

	:error21
	echo.
	echo ͻ
	echo     ***  WARNING  ***                        ***  NON-CRITICAL ERROR  ***  
	echo  A "system" error has occured while SCANNING your local drives for viruses.
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  ErrorLevel=21+                                                            
	echo                                                                            
	echo ͼ
	pause
	echo ---------------------------------------------------------------------      >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo A "system" error has occured while SCANNING your local drives for viruses. >>K:SCAN.LOG 
	echo ErrorLevel 21 occured at above date / time                                 >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo A "system" error has occured while SCANNING your local drives for viruses. >>o:\viruslog\allscan.log
	echo ErrorLevel 21 occured at above date / time on User %log_name%              >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto END

	:error20
	echo.
	echo ͻ
	echo     ***  WARNING  ***                        ***  NON-CRITICAL ERROR  ***  
	echo  The SCANNING /FREQUENCY is set to ON and your last SCAN falls within an   
	echo  acceptable time frame.                                                    
	echo ͹
	echo  ErrorLevel=20                                                             
	echo                                                                            
	echo ͼ
	rem pause
	goto AFTEREND

	:error18
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  A validation file has been modified (/CF or /CV options).                 
	echo  ErrorLevel=18                                                             
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo A validation file has been modified (/CF or /CV options).                  >>K:SCAN.LOG
	echo ErrorLevel 18 occured at above date / time                                 >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo A validation file has been modified (/CF or /CV options).                  >>o:\viruslog\allscan.log
	echo ErrorLevel 18 occured at above date / time on User %log_name%              >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto END

	:error17
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  No drive, directory or file was specified; nothing to scan.               
	echo  ErrorLevel=17                                                             
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG  
	echo No drive, directory or file was specified; nothing to scan.                >>K:SCAN.LOG  
	echo ErrorLevel 17 occured at above date / time                                 >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo No drive, directory or file was specified; nothing to scan.                >>o:\viruslog\allscan.log  
	echo ErrorLevel 17 occured at above date / time on User %log_name%              >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto END
		
	:error16
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  An error occured while accessing a specified drive or file.               
	echo  ErrorLevel=16                                                             
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo An error occured while accessing a specified drive or file.                >>K:SCAN.LOG
	echo ErrorLevel 16 occured at above date / time                                 >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo An error occured while accessing a specified drive or file.                >>o:\viruslog\allscan.log
	echo ErrorLevel 16 occured at above date / time on User %log_name%              >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error15
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  VirusScan self-check failed. It may be infected or damaged.               
	echo  ErrorLevel=15                                                             
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo VirusScan self-check failed. It may be infected or damaged.                >>K:SCAN.LOG
	echo ErrorLevel 15 occured at above date / time                                 >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo VirusScan self-check failed. It may be infected or damaged.                >>o:\viruslog\allscan.log
	echo ErrorLevel 15 occured at above date / time on User %log_name%              >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.                                                                           
	goto end

	:error14
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  The SCAN.DAT file is out of date; upgrade VirusScan data files.           
	echo  ErrorLevel=14                                                             
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo The SCAN.DAT file is out of date; upgrade VirusScan data files.            >>K:SCAN.LOG
	echo ErrorLevel 14 occured at above date / time                                 >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo The SCAN.DAT file is out of date; upgrade VirusScan data files.            >>o:\viruslog\allscan.log
	echo ErrorLevel 14 occured at above date / time on User %log_name%              >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error13
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  VIRUS  ***     
	echo  An error has occured while SCANNING your local drives for viruses         
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  One or more viruses were found in the master boot record, or boot sector, 
	echo  or a virus(s) were found in the files listed.                             
	echo  ErrorLevel=13                                                             
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo Virus(s) were found in the MBR or LBS, or were found in the files listed.  >>K:SCAN.LOG
	echo ErrorLevel 13 occured at above date / time                                 >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo Virus(s) were found in the MBR or LBS, or were found in the files listed.  >>o:\viruslog\allscan.log
	echo ErrorLevel 13 occured at above date / time on User %log_name%              >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto NOTINMEM
			  
	:error12
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  An error occured while attempting to remove a virus, such as no           
	echo  CLEAN.DAT file found, or VirusScan was unable to remove the virus.        
	echo  ErrorLevel=12                                                             
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo Error removing a virus, such as no CLEAN.DAT, unable to remove the virus.  >>K:SCAN.LOG       
	echo ErrorLevel 12 occured at above date / time                                 >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo Error removing a virus, such as no CLEAN.DAT, unable to remove the virus.  >>o:\viruslog\allscan.log       
	echo ErrorLevel 12 occured at above date / time on User %log_name%              >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end
			  
	:error11
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  An internal program error occurred.                                       
	echo  ErrorLevel=11                                                             
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo An internal program error occurred.                                        >>K:SCAN.LOG
	echo ErrorLevel 11 occured at above date / time                                 >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo An internal program error occurred.                                        >>o:\viruslog\allscan.log
	echo ErrorLevel 11 occured at above date / time on User %log_name%              >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error10
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  VIRUS  ***     
	echo  A virus found in memory this could be an actual virus or traces left from 
	echo  a prior operation. Possibly a false alarm generated by a conflict or TSR. 
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  A virus was found in memory.                                              
	echo  ErrorLevel=10                                                             
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo A virus was found in memory.                                               >>K:SCAN.LOG 
	echo ErrorLevel 10 occured at above date / time                                 >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo A virus was found in memory.                                               >>o:\viruslog\allscan.log 
	echo ErrorLevel 10 occured at above date / time on User %log_name%              >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto critical

	:error9
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  Incompatible or unrecognized option(s) or arguements were specified       
	echo  ErrorLevel=9                                                              
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo Incompatible or unrecognized option(s) or arguements were specified        >>K:SCAN.LOG
	echo ErrorLevel 9 occured at above date / time                                  >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo Incompatible or unrecognized option(s) or arguements were specified        >>o:\viruslog\allscan.log
	echo ErrorLevel 9 occured at above date / time on User %log_name%               >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error8
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  A file required to run VirusScan, such as SCAN.DAT, is missing.           
	echo  ErrorLevel=8                                                              
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo A file required to run VirusScan, such as SCAN.DAT, is missing.            >>K:SCAN.LOG
	echo ErrorLevel 8 occured at above date / time                                  >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo A file required to run VirusScan, such as SCAN.DAT, is missing.            >>o:\viruslog\allscan.log
	echo ErrorLevel 8 occured at above date / time on User %log_name%               >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error7
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  An error in accessing an international message file (MCAFEE.MSG)          
	echo  ErrorLevel=7                                                              
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo An error in accessing an international message file (MCAFEE.MSG)           >>K:SCAN.LOG
	echo ErrorLevel 7 occured at above date / time                                  >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo An error in accessing an international message file (MCAFEE.MSG)           >>o:\viruslog\allscan.log
	echo ErrorLevel 7 occured at above date / time on User %log_name%               >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error6
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  An internal program error occurred.                                       
	echo  ErrorLevel=6                                                              
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo An internal program error occurred.                                        >>K:SCAN.LOG
	echo ErrorLevel 6 occured at above date / time                                  >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo An internal program error occurred.                                        >>o:\viruslog\allscan.log
	echo ErrorLevel 6 occured at above date / time on User %log_name%               >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error5
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  MEMORY ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  Insufficient memory to load program or complete operation.                
	echo  ErrorLevel=5                                                              
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo Insufficient memory to load program or complete operation.                 >>K:SCAN.LOG
	echo ErrorLevel 5 occured at above date / time                                  >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo Insufficient memory to load program or complete operation.                 >>o:\viruslog\allscan.log
	echo ErrorLevel 5 occured at above date / time on User %log_name%               >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error4
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  An error occured while accessing the file created with the /AF option.    
	echo  ErrorLevel=4                                                              
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo An error occured while accessing the file created with the /AF option.     >>K:SCAN.LOG
	echo ErrorLevel 4 occured at above date / time                                  >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo An error occured while accessing the file created with the /AF option.     >>o:\viruslog\allscan.log
	echo ErrorLevel 4 occured at above date / time on User %log_name%               >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error3
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  An error occured while accessing a disk (reading or writing).             
	echo  ErrorLevel=3                                                              
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo An error occured while accessing a disk (reading or writing).              >>K:SCAN.LOG
	echo ErrorLevel 3 occured at above date / time                                  >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo An error occured while accessing a disk (reading or writing).              >>o:\viruslog\allscan.log
	echo ErrorLevel 3 occured at above date / time on User %log_name%               >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error2
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  ERROR  ***     
	echo  An error has occured while SCANNING your local drives for viruses.        
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  A VirusScan database (*.DAT) file is corrupted.                           
	echo  ErrorLevel=2                                                              
	echo ͼ
	echo.
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo A VirusScan database (*.DAT) file is corrupted.                            >>K:SCAN.LOG
	echo ErrorLevel 2 occured at above date / time                                  >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo A VirusScan database (*.DAT) file is corrupted.                            >>o:\viruslog\allscan.log
	echo ErrorLevel 2 occured at above date / time on User %log_name%               >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error1
	echo.
	echo ͻ
	echo     ***  WARNING  ***                                  ***  VIRUS  ***     
	echo  A virus has been detected by VirusScan.                                   
	echo  Please refer to your documentation or contact SysAdmin / Help Desk        
	echo ͹
	echo  Error occured while accessing a file (reading or writing).                
	echo                                                                            
	echo ͼ
	echo.                                 
	pause
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	z:\SYSTIME                                                                      >>K:SCAN.LOG
	echo Error occured while accessing a file (reading or writing).                 >>K:SCAN.LOG
	echo ErrorLevel 1 occured at above date / time                                  >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	z:\SYSTIME                                                                      >>o:\viruslog\allscan.log
	echo Error occured while accessing a file (reading or writing).                 >>o:\viruslog\allscan.log
	echo ErrorLevel 1 occured at above date / time on User %log_name%               >>o:\viruslog\allscan.log
	echo %log_name% is located at station number %station%                          >>o:\viruslog\allscan.log 
	echo.
	goto end

	:error0
	echo.
	echo ͻ
	echo     ***  ALL GOOD  ***                            *** NO PROBLEMS  ***     
	echo               Everything ran fine.  There is no problem!                   
	echo                                                                            
	echo ͼ
	echo.
	rem pause not needed when everything is ok
	echo.
	goto afterend

	:end
	echo ͻ
	echo        A NON-CRITICAL ERROR HAS OCCURED, PLEASE MAKE A NOTE OF IT          
	echo             YOU WILL TEMPORARILY BE ALLOWED ONTO THE NETWORK               
	echo                 PLEASE CONTACT YOUR SYSTEM ADMINISTRATOR                   
	echo                                                                            
	echo ͼ
	pause
	echo off
	goto afterend

	:NOTINMEM                       <---- ERRORLEVEL #13
	echo ͻ
	echo                    *** VIRUS ALERT ERROR ***                               
	echo  A VIRUS WAS FOUND, HOWEVER YOU WILL BE ALLOWED TO CONTINUE AT THIS TIME   
	echo  IF THE VIRUS CONTINUES YOU MAY NOT BE ALLOWED ONTO THE NETWORK NEXT TIME  
	echo                                                                            
	echo              PLEASE CONTACT THE SYSADMIN / HELP DESK AT # xxxx             
	echo                                                                            
	echo ͼ
	echo off
	echo ͻ
	echo   WOULD YOU LIKE TO ATTEMPT TO CLEAN THE VIRUS NOW? (y/n)                  
	echo ͼ
	choice /c:yn /t:y,10            <---- prompts user for yes on no, defaults to yes after 10 seconds
	if errorlevel 2 goto afterend   <---- if N
	if errorlevel 1 goto clean      <---- if Y
	goto afterend

	:CRITICAL                       <---- ERRORLEVEL #10
	echo ͻ
	echo                    *** CRITICAL VIRUS ERROR ***                            
	echo     SINCE A CRITICAL ERROR HAS OCCURED YOU ARE NOW BEING LOGGED OFF        
	echo              PLEASE CONTACT THE SYSADMIN / HELP DESK AT # xxxx             
	echo                                                                            
	echo ͼ
	echo off
	z:\LOGOUT.EXE
	goto offnet

	:afterend
	rem the syntax of the following line is critical; if there is a space after = it will not work!
	set SCAN=YES              <---- Now the DOS SCAN Variable has been set until the user re-boots.
	echo off
	echo ͻ
	echo  Virus Scanning has completed successfully                                 
	echo  You will now be prompted for your password...                             
	echo ͼ
	login %log_name%          <---- Remebers the users login name so that all they have to retype is password.
					and will now re-run login script of course this time SCAN will equal YES and
					the batch file MCAFEE.BAT will not be executed.
	goto offnet

	:clean
	O:\SCAN C: /NOBREAK /report k:lastscan.rpt /frequency 96 /clean
	goto afterend
	
	:offnet                   <---- THIS IS THE VERY END.....




After completion of the scanning it is possible to check if VSHIELD is loaded
this can be done by calling CHK4VSH.BAT is utilized in the above example by
using a group called SCANTSR.  The CHK4VSH.BAT should look something like the 
following:

	CHK4VSH.BAT - (also included seperately)
	-----------------------------------------
	@echo off

	REM ͻ
	REM  This batch file is intended to check for McAfee's Vshield 2.x      
	REM  Written by: DJ TECH @ McAfee PSET - June  1995                     
	REM ͼ

	REM REPLACE "XXX" WITH CURRENT VERSION NUMBER
	x:CHKVSHLD 
	if errorlevel 3 goto error3
	if errorlevel 2 goto error2
	if errorlevel 1 goto error1
	if errorlevel 0 goto error0

	:ERROR3
	   echo ͻ
	   echo   A CHKVSHLD internal error has occurred.     
	   echo       Please contact the Help Desk.           
	   echo ͼ
	   echo.
	   pause
	   echo ----------------------------------------------------------------------  >>K:C4VSH.LOG
	   F:\PUBLIC\SYSTIME                                                            >>K:C4VSH.LOG
	   echo CHKVSHLD ErrorLevel 3 occured at above date / time                      >>K:C4VSH.LOG
	   echo ----------------------------------------------------------------------  >>X:\MCAFEE\ALLC4VSH.LOG
	   F:\PUBLIC\SYSTIME                                                            >>X:\MCAFEE\ALLC4VSH.LOG
	   echo CHKVSHLD ErrorLevel 3 occured at above date / time on User %USER_ID%    >>X:\MCAFEE\ALLC4VSH.LOG
	   
	   REM THE NEXT LINE WOULD BE WHERE THE BATCH FILE WOULD LOGOUT THE USER IF AN ERROR OCCURED CHECKING FOR VSHIELD
	   rem LOGOUT
	   
	goto end

	:ERROR2
	   echo ͻ
	   echo  VShield has not been installed on your PC.   
	   echo      Access to network has been denied.       
	   echo        Please contact the Help Desk.          
	   echo ͼ
	   echo.
	   pause
	   echo ----------------------------------------------------------------------  >>K:C4VSH.LOG
	   F:\PUBLIC\SYSTIME                                                            >>K:C4VSH.LOG
	   echo CHKVSHLD ErrorLevel 2 occured at above date / time                      >>K:C4VSH.LOG
	   echo ----------------------------------------------------------------------  >>X:\MCAFEE\ALLC4VSH.LOG
	   F:\PUBLIC\SYSTIME                                                            >>X:\MCAFEE\ALLC4VSH.LOG
	   echo CHKVSHLD ErrorLevel 2 occured at above date / time on User %USER_ID%    >>X:\MCAFEE\ALLC4VSH.LOG

	   REM THE NEXT LINE WOULD BE WHERE THE BATCH FILE WOULD LOGOUT THE USER NOT LOADING VSHIELD
	   rem LOGOUT
	   
	goto end

	:ERROR1
	   echo ͻ
	   echo  An old version of VShield has been installed.
	   echo  Access to the network has been denied. Please
	   echo  contact the Help Desk to have a new version  
	   echo  installed.                                   
	   echo ͼ
	   echo.
	   pause
	   echo ----------------------------------------------------------------------  >>K:C4VSH.LOG
	   F:\PUBLIC\SYSTIME                                                            >>K:C4VSH.LOG
	   echo CHKVSHLD ErrorLevel 1 occured at above date / time                      >>K:C4VSH.LOG
	   echo ----------------------------------------------------------------------  >>X:\MCAFEE\ALLC4VSH.LOG
	   F:\PUBLIC\SYSTIME                                                            >>X:\MCAFEE\ALLC4VSH.LOG
	   echo CHKVSHLD ErrorLevel 1 occured at above date / time on User %USER_ID%    >>X:\MCAFEE\ALLC4VSH.LOG
	   
	   REM THE NEXT LINE WOULD LOGOUT THE USER IF THEY DID NOT HAVE THE SPECIFIC VERSION OF VSHIELD SPECIFIED
	   REM OF COURSE THAT WOULD REQUIRE THE /V "XXXX" PARAMETER AT THE BEGINNING OF THIS BATCH FILE.
	   rem LOGOUT
	   goto end

	:ERROR0
	   echo ͻ
	   echo  The current version of VShield has been installed.
	   echo ͼ
	   echo.
	   set scantsr="yes"
	   
	:end


Note: The following lines are utilized throughout the 2 batch files, they create a report
      log. One is in the users directory and the other is in a common place. This will 
      allow the system admin to keep track of what users are getting errors and what 
      the errors are.
	echo ----------------------------------------------------------------------     >>K:SCAN.LOG
	F:\PUBLIC\SYSTIME                                                               >>K:SCAN.LOG
	echo xxxxx ErrorLevel 1 occured at above date / time                            >>K:SCAN.LOG
	echo ----------------------------------------------------------------------     >>o:\viruslog\allscan.log
	F:\PUBLIC\SYSTIME                                                               >>o:\viruslog\allscan.log
	echo xxxxx ErrorLevel 1 occured at above date / time on User %USER_ID%          >>o:\viruslog\allscan.log

Step 7.
After the CHK4VSH.BAT has completed successfully the SCANTSR will be set to YES
so that when the LOGIN script is executed again it will pass through the normal 
LOGIN script.

Step 8.
Make sure you grant RIGHTS to EVERYONE to the SYS:\MCAFEE\ directory. 
   -READ, WRITE, CREATE, MODIFY

TIPS, TECHNIQUES and Other Important Stuff to Know:
---------------------------------------------------
- if users LOGIN to another server first this will not work unless it has also
  been converted. Tip to force this would be to make this server their PREFERRED
  SERVER in their NET.CFG file. This will force them to run the LOGIN script 
  rather than ATTACH.EXE.
- if users ATTACH to the server rather that LOGIN they will not be running the
  system login script or the batch files created.
- when new versions of SCAN are available they just need to be placed into the
  X:\MCAFEE\ directory.  This will ensure the latest version of scan is being
  used.
- if a user finds traces of a particular virus in memory the admin will have to
  go to the workstation and cold boot it from a clean, DOS, write-protected 
  floppy and then run SCAN C: /CLEAN from a floppy.
- "FILE CREATION ERROR" - can mean many different things
   - user doesn't have a user directory needed to create a .LOG file
   - user doesn't have rights to create a .LOG file as specified
- INVALID DRIVE SPECIFICATION
   - if using drive Z:,K:,O: as specified in the examples make sure the users
     do not have a LASTDRIVE= statement where it is set to something higher than E:
- if user gets error: 
	-->     There is no room to expand the PATH environment variable with the mapping:
		"MAP ROOT x:=SYS:\ "                                                            <---- or something similiar
	** OR **
	-->     Could not add "LOG_NAME=DJOHNSON" to the local enviroment variables             <---- or something similiar
	** OR **
	-->     Out of environment space
	** OR **
	-->     MEMORY ALLOCATION ERROR
		CANNOT LOAD COMMAND SYSTEM HALTED

   any of these messages could be a sign that there is not enough environment space
   this can be addressed by increasing the /E parameter on the SHELL = line in config.sys
- in some very rare cases a user may get:
	--> run-time error R6009
	    -not enough space for environment
  
  this will ONLY occur if the user has very low memory, around 200k of
  conventional memory, which is to low for anything including the compiler
  interpreter. However the MCAFEE.BAT will return an error level 21+    


PLEASE NOTE:
This is just one possible implementation of SCAN and VSHIELD, however due to 
the memory limitations SCAN can not always be executed directly from the 
system login script.


MIS/ADMIN Notes:
----------------
The O:ALLSCAN.LOG (SYS:\MCAFEE\ALLSCAN.LOG) will be the central location where users 
errorlevels are recorded.  So the SYS:\MCAFEE\ALLSCAN.LOG should be viewed frequently 
to check who is getting errors.

For a more detailed report each user has their own SCAN.LOG located in their
HOME USER directory (K: or SYS:USER\ or SYS:\HOME).  Also in the same directory
is a file called LASTSCAN.RPT, which contains the report generated by SCAN.  
The LASTSCAN.RPT not only can point out specific problems, it also will be
time and date stamped the last time SCAN was run (even if it was succesful).


Options in MCAFEE.BAT
---------------------
(1) SCAN C:\                            <---- will just scan root of drive c:
(2) SCAN C:                             <---- will scan all of drive c: including MBR/LBS
(3) SCAN C: /ALL                        <---- same as (2) and all files which have a 
					      executable header regardless of extension
(4) SCAN C: /REPORT K:lastscan.rpt      <---- same as (2) and will write a report file 
					      named lastscan.rpt to K: drive.
(5) SCAN C: /FREQUENCY 48               <---- same as (2) except if a scan has been performed
					      in last 48 hours it will skip scanning and return
					      a errorlevel 20 in MCAFEE.BAT. 48 can be substitued
					      with any number, which is the number of hours. SCAN
					      uses a hidden file MCAFEE.FRC in the root of the C:
					      drive to keep track of the last scan.
(6) SCAN C: /NOBREAK                    <---- will make scan complete without giving the ability
					      to CTRL-BREAK out before completion.
(7) SCAN C: /PAUSE                      <---- will pause the scanning output when the screen fills,
					      so that messages will not scroll by before being read.
(8) SCAN /ADL                           <---- will scan ALL DRIVES LOCAL (C:, D:) except floppies.
(9) SCAN /ADN                           <---- will scan ALL DRIVES NETWORK, everything currently mapped.
 
