This script will update both Win9x and WinNTWS. (if I can get the service to stop)
both the 3x scan engine and the 4x scan engine.
The problem is stopping a service on the NTWS without giving the domain users admin rights.
Works great on 9x.
mail comments to mikef@madix.comCODE TO FOLLOW:
;**********************************************************************************
; Author: Michael Lewis Frice
; Email : mikef@madix.com
; Description: This script is called from login script and then simply updates McAfee
; virus scan "Dat" files for versions 3.xx and 4.xx on Windows 95 and NT workstations.
;**********************************************************************************
$RETURNCODES=ExistKey("HKEY_LOCAL_MACHINE\SOFTWARE\MCAFEE\SCAN95")
If $RETURNCODES=0
$win95=Readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\MCAFEE\SCAN95","DAT")
$VER=Readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\MCAFEE\SCAN95","CURRENTVERSIONNUMBER")
ELSE GOTO NT40
ENDIF
;**********************************************************************************
;**********************************************************************************
IF $VER < 3
GOTO Log
ENDIF
IF $VER => 4
GOTO w95B
ENDIF
if exist ("$win95" + "\backup") = 0
md ("$win95" + "\backup")
endif
if exist ("$win95" + "\TMP") = 0
md ("$win95" + "\TMP")
endif
if exist ("$win95" + "\backup\@ydayno") = 0
md ("$win95" + "\backup\@ydayno")
endif
$backup = $win95 + "\backup\@ydayno"
$source = $win95 + "\*.DAT"
$tmp = $win95 + "\tmp"
$rename = $tmp + "\*.dat *.tmp"
$tmpcopy = $tmp + "\*.tmp"
SHELL '%comspec% /e:1024 /c XCOPY "$source" "$backup"'
shell '%comspec% /e:1024 /c xCOPY \\pdxnt3\vir_upd\DAT_FILE\ver3\*.DAT /d "$tmp"'
shell '%comspec% /e:1024 /c rename c:\progra~1\mcafee\viruss~1\tmp\*.dat *.tmp'
shell '%comspec% /e:1024 /c move "$tmpcopy" "$win95"'
goto wininit
;**********************************************************************************
;****** Windows 9x section VirusScan V 4.x ****************************************
;**********************************************************************************
:w95B
if exist ("$win95" + "\backup") = 0
md ("$win95" + "\backup")
endif
if exist ("$win95" + "\TMP") = 0
md ("$win95" + "\TMP")
endif
if exist ("$win95" + "\backup\@ydayno") = 0
md ("$win95" + "\backup\@ydayno")
endif
$backup = $win95 + "\backup\@ydayno"
$source = $win95 + "\*.DAT"
$tmp = $win95 + "\tmp"
$rename = $tmp + "\*.dat *.tmp"
$tmpcopy = $tmp + "\*.tmp"
SHELL '%comspec% /e:1024 /c XCOPY "$source" "$backup"'
shell '%comspec% /e:1024 /c xCOPY \\pdxnt3\vir_upd\DAT_FILE\ver4\*.DAT /d "$tmp"'
shell '%comspec% /e:1024 /c rename c:\progra~1\mcafee\viruss~1\tmp\*.dat *.tmp'
shell '%comspec% /e:1024 /c move "$tmpcopy" "$win95"'
goto wininit
;**********************************************************************************
;****** Windows NT section*********************************************************
;**********************************************************************************
:NT40
$RETURNCODE=ExistKey("HKEY_LOCAL_MACHINE\SOFTWARE\MCAFEE\VIRUSSCAN")
If $RETURNCODE=0
$NT=Readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\MCAFEE\VIRUSSCAN","DAT")
$VER=Readvalue("HKEY_LOCAL_MACHINE\SOFTWARE\MCAFEE\VIRUSSCAN","SZENGINEVER")
else exit
ENDIF
IF $VER < 3
GOTO Log
ENDIF
IF $VER => 4
GOTO NTB
ENDIF
if exist ("$NT" + "\backup") = 0
md ("$NT" + "\backup")
endif
if exist ("$NT" + "\backup\@ydayno") = 0
md ("$NT" + "\backup\@ydayno")
endif
$backup = $NT + "backup\@ydayno"
$source = $NT + "*.DAT"
SHELL '%comspec% /e:1024 /c XCOPY "$source" "$backup"'
SHELL '%comspec% /e:1024 /c net stop "mcafee virusscan task manager"'
SHELL '%comspec% /e:1024 /c XCOPY \\pdxnt3\vir_upd\DAT_FILE\ver3\*.DAT /D "$NT"'
SHELL '%comspec% /e:1024 /c net start "mcafee virusscan task manager"'
GOTO Log
EXIT
;**********************************************************************************
;**********************************************************************************
:NTB
if exist ("$NT" + "\backup") = 0
md ("$NT" + "\backup")
endif
if exist ("$NT" + "\backup\@ydayno") = 0
md ("$NT" + "\backup\@ydayno")
endif
$backup = $NT + "backup\@ydayno"
$source = $NT + "*.DAT"
SHELL '%comspec% /e:1024 /c XCOPY "$source" "$backup"'
SHELL '%comspec% /e:1024 /c net stop "mcafee virusscan task manager"'
SHELL '%comspec% /e:1024 /c XCOPY \\pdxnt3\vir_upd\DAT_FILE\VER4\*.DAT /D "$NT"'
SHELL '%comspec% /e:1024 /c net start "mcafee virusscan task manager"'
GOTO Log
exit
:wininit
;**********************************************************************************
; Create WININIT.INI file so to update SCAN.TMP to SCAN.DAT on reboot
;**********************************************************************************
if Open(1, "c:\windows\wininit.ini", 5) = 0
$x = WriteLine(1, "[rename]" + Chr(13) + Chr(10))
$x = writeline(1, "C:\PROGRA~1\MCAFEE\VIRUSS~1\SCAN.DAT=C:\PROGRA~1\MCAFEE\VIRUSS~1\SCAN.tmp" + chr(13) + chr(10))
$x = writeline(1, "C:\PROGRA~1\MCAFEE\VIRUSS~1\clean.DAT=C:\PROGRA~1\MCAFEE\VIRUSS~1\clean.tmp" + chr(13) + chr(10))
$x = writeline(1, "C:\PROGRA~1\MCAFEE\VIRUSS~1\internet.DAT=C:\PROGRA~1\MCAFEE\VIRUSS~1\internet.tmp" + chr(13) + chr(10))
$x = writeline(1, "C:\PROGRA~1\MCAFEE\VIRUSS~1\polyscan.DAT=C:\PROGRA~1\MCAFEE\VIRUSS~1\polyscan.tmp" + chr(13) + chr(10))
$x = writeline(1, "C:\PROGRA~1\MCAFEE\VIRUSS~1\names.DAT=C:\PROGRA~1\MCAFEE\VIRUSS~1\names.tmp" + chr(13) + chr(10))
close (1)
endif
;**********************************************************************************
;****Log the new virus definiations, the date and the time ***********************
;**********************************************************************************
:Log
IF redirectoutput("\\pdxnt2\kixlogs\workst~1\@wksta\@wksta.vscan.txt") = 0
?"["@wksta"]"
endif
IF $VER < 3
?"Mcafee virus scan ver is to old to update."
?"Virus ScanEngine = $VER"
messagebox("Mcafee virus scan ver is to old to update.", "McAfee Virus Update", 16)
exit
endif
?"Virus ScanEngine = $VER"
?"Dat Files updated "@date
if messagebox("Mcafee virus definiations have been updated. The new definiations will be loaded when Windows is restarted.", "McAfee Virus Update", 64) = 1
endif
exit