Will Hetrick
Hey THIS is FUN
Registered: 2001-10-02
Posts: 320
Loc: Harrisburg, PA USA
|
Brian, Let me explain my three chances rule. In the kix script itself, I check the dat version they are currently running. If it does not match with the Current dat file, I try to update it by running the Mupdate utility Included in Virusscan. Then I check the dat version again. If the dat version is not updated that way, I run the superdat/exedat/engine dat depending on what they need. Then I check the dat version again. If that did not work, The third strike I shut them down. They do not get to see or make a decision in this process. Here is the code to show you what I mean. code:
; ;------Finds an Superdat in the Server path $sdatName=Dir($ServPath + "sdat*.exe") ;------Look for a more recent superdat While $sdatName <>"" AND @ERROR = 0 If $sdatname <>"" $sname=$sdatname EndIf $sdatName=Dir() ; retrieve next file Loop
;------Find an Extra dat file in the server path $XdatName=Dir($ServPath + "*xdat.exe") ;------Look for a more recent extra dat file While $XDatName <>"" AND @ERROR = 0 If $XDatname <>"" $Xname=$XDatname EndIf $XDatName=Dir() ; retrieve next file Loop
;------Look for the available engine version $EngName=Dir($ServPath + "*eng.exe") ;------Look for a more recent Engine file While $EngName <>"" AND @ERROR = 0 If $EngName <>"" $Ename=$EngName EndIf $EngName=Dir() ; retrieve next file Loop
;------Extract only the first four digits of the extra dat file $XCheck=SubStr($Xname,1,4) $ECheck=SubStr($EName,1,4)
;-------Compact the values returned to just four digits ;--------so they can be compared to the values returned ;---------by the file names earlier $Regver2=SubStr($regver,5,4) $ENGVER2=SubStr($ENGVER,1,1) + SubStr($ENGVER,3,1) + SubStr($ENGVER,5,2)
Select Case ($Macver = "NONE") OR ($Macver = " ") OR ($Macver = "") If $check = 3 Goto Shutoff EndIf Case ($regver2 = $Xcheck) AND ($engver2 = $Echeck) Goto EndUpdateMcafee
Case ($regver2 <> $Xcheck) AND ($engver2 = $Echeck) $RC=WriteValue("$McUpdate\CurrentVersion\Update\Update Site1","szFTPLocation",$dats,REG_SZ) Shell "%comspec% /e:1024 /c C:\PROGRA~1\commoN~1\networ~1\mcupdate\mcupdate /task update /quiet" If (@error <> 0) OR ($check = 1) Shell $servpath + $Xname + " /s" EndIf Case ($regver2 = $Xcheck) AND ($engver2 <> $Echeck) Shell $servpath + $Ename + " /s"
Case ($regver2 <> $Xcheck) AND ($engver2 <> $Echeck) Shell $servpath + $sname + " /s"
Case 1
EndSelect
$check = $check + 1
If $check = 3 If (Val($regver2) + 1 < $Xcheck) OR (Val($engver2) < $Echeck) :Shutoff $X = LogInfo($Server16 + "auditlog\NEEDMCAFEE.TXT","@DATE @TIME,@WKSTA,@LDOMAIN\@USERID,@Producttype,@csd,$myip,@address") $logit = Shutdown("","Restarting Your Computer. The virus settings are not up to date, please try to login again.",15,1,1) Exit 1 EndIf Else Goto VirusCheck EndIf
:EndUpdateMcafee
The goto's in this code refers to the sections that does the checking and logging off. I am working on making them functions to make the code flow a little better. [ 09 May 2002, 14:51: Message edited by: Will Hetrick ]
_________________________
You have at least 2 choices. Each choice changes your destiny. Choose wisely!
|