Page 1 of 1 1
Topic Options
#6786 - 2001-02-08 08:38 PM Mcafee version number
Anonymous
Unregistered


Hello all,
I am having a problem writing a script to check a users Mcafee Vscan version number at logon and write it to a hidden file on the PDC. We are running win98 under NT4. Mcafee seems to be in Network assotiates\TVD reg key not Mcafee\vscan as is posted elsewhere.
I will need the userid and workstation to be logged with the version number also the date/ time.
I have tried using writeline , after extracting the info but all i get is an empty file !!!!


In desparation

Steve ( The novice)

Top
#6787 - 2001-02-08 08:45 PM Re: Mcafee version number
Shawn Administrator Offline
Administrator
*****

Registered: 1999-08-13
Posts: 8611
Steve...

Let's see your code...

Shawn.

Top
#6788 - 2001-02-08 08:51 PM Re: Mcafee version number
Anonymous
Unregistered


Thank for the reply ,
its on my work PC i will post it in the Am UK time (20:00 now)

Steve

Top
#6789 - 2001-02-08 11:38 PM Re: Mcafee version number
Anonymous
Unregistered


Here is what I have. I have it pulling the sdat41XX.exe from a batch file for updates.

:McAfeeUpdate
? "Checking McAfee definition files"
; obtain DAT version on client system
$Result=Readvalue("Hkey_Local_Machine\Software\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx","szDatVersion")
$ClientDATVer = (0 + SUBSTR($Result, LEN($Result) - 3, 4))

; obtain approved released DAT version
$Result = ReadProfileString("\\Server\LatestDATs$\config.ini", "VirusScan Engine", "VirusDefinition")
$AppDATVer = (0 + SUBSTR($Result, LEN($Result) - 3, 4))

; determine if SDAT needs to be launched
if $ClientDATVer < $AppDATVer
; DAT version on Client is older than that on the server - Run SDAT
$SDAT = ReadProfileString("\\Server\LatestDATs$\config.ini", "VirusScan Engine", "SDATFileName")
SHELL ("%comspec% /e:1024 /c Start /w \\Server\LatestDATs$\$SDAT /s")
else
; DAT version on Client is the same version or newer than that on the server - Do nothing
endif
".]"

Config.ini:
[VirusScan Engine]
VirusDefinition=4.0.4120
SDATFileName=sdat4120.exe


In my hidden share on the server I have a file called Config.ini and the latest sdat executable. A log is also created when the sdat is run. Hope this helps and takes a load off your mind!


Top
#6790 - 2001-02-09 06:54 PM Re: Mcafee version number
Radimus Moderator Offline
Moderator
*****

Registered: 2000-01-06
Posts: 5187
Loc: Tampa, FL
Try this... It is a bit more involved.
code:

; ******************************* McAfee NetShield Section ***********************************
if $os="WinNT"
if existkey("HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\VirusScan")<>0
? color r+/n " McAfee NetShield is not installed" color w/n
shell("$server\mcafee$$\$os\install\setup.exe -s")
else
$McAfeeRegKey="HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\VirusScan"
$McAfeeEngKey="HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\VirusScan\Tasks\Upgrade"
$McAfeeAltKey="HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\AlertManager\Recipients"
$HKLMSMVSDT="HKEY_LOCAL_MACHINE\SOFTWARE\McAfee\VirusScan\McShield\CurrentVersion"
$prd=readvalue("$McAfeeRegKey", "szProductVer")
$eng=readvalue("$McAfeeRegKey", "szEngineVer")
$dat=readvalue("$McAfeeRegKey", "szVirDefVer")
$Mcdate=readvalue("$McAfeeRegKey", "szVirDefDate")
$mceng=READVALUE("$McAfeeEngKey", "szUpgradeCMD")
$mcexe=READVALUE("$McAfeeRegKey", "szUpdateEXE")
$datdir=readvalue("$McAfeeRegKey","DAT")
$scanner=readvalue("$McAfeeRegKey","scan32exe")
$exts=readvalue("$HKLMSMVSDT","szProgExts")
$runscan=0
$datupdate=0

$DatPath="$server"+"\mcafee$$\WinNT\Update"
$EngPath="$server"+"\mcafee$$\WinNT\Upgrade"

; **************************** Upgrade Engine Section **********************************
? " Installed "color c+/n"McAfee NetShield "color w/n"is version " color w+/n $prd color w/n " engine "color w+/n $eng color w/n
if $eng<$McEngine
$=WRITEVALUE("$McAfeeEngKey", "szUpdateUncLocation", "$EngPath", "REG_SZ")
$=WRITEVALUE("$McAfeeEngKey", "uUpdateFrom", "1", "REG_DWORD")
? color g+/n" The Antivirus Program on your computer is being updated" color w/n
shell "$engpath"+"\"+"$mceng"
$runscan=1
endif
; ******************************* Upgrade DAT Section ***********************************
? " Installed "color c+/n"McAfee DAT "color w/n"is version " color w+/n $dat color w/n " dated " color w+/n $Mcdate color w/n
$datver1=substr("$dat",5,4)
$datver2=substr("$dat",3,4)
if instr("$datver1",".")=0
$datver=$datver1
else
$datver=$datver2
endif
$datfile=dir("$datpath\dat*.zip")
while $datfile<>"" and @error=0 and $datupdate=0
$datfilever=substr("$datfile",5,4)
if $datfilever>$datver
? color g+/n" Updating Antivirus signatures" color w/n
$=WRITEVALUE("$McAfeeRegKey"+"\Tasks\Update", "szUpdateUncLocation", "$DatPath", "REG_SZ")
$=WRITEVALUE("$McAfeeRegKey"+"\Tasks\Update", "uUpdateFrom", "1", "REG_DWORD")
shell "$mcexe /task update"
$runscan=1
$datupdate=1
; ************************* Alert Recipients Section *********************
$Rep='Priority Level:"1" Type:"Network Message" Recipient:"\\'
$=writevalue("$McAfeeAltKey","Recipient0","$rep"+$dcsa+chr(34),"REG_SZ")
$=delvalue("$McAfeeAltKey","Recipient1")
endif
$datfile=dir()
loop
; ********************************* Extra DAT Section ************************************
$dattime=comparefiletimes("$datpath"+"\extra.dat","$datdir"+"extra.dat")
if $dattime=-3 or $dattime=1
shell("%comspec% /c net stop mcshield >nul")
copy "$datpath"+"\extra.dat" "$datdir"
if @error=0
? color g+/n " Extra Dat loaded" color w/n
$runscan=1
endif
shell("%comspec% /c net start mcshield >nul")
endif
; *********************** Run Silent Scan Section *****************************
if $runscan=1
run ("$scanner"+" /uinone /clean /delete /exit")
? color g+/n " Starting Virus Scan" color w/n
endif
endif


_________________________
How to ask questions the smart way <-----------> Before you ask

Top
#6791 - 2001-02-09 08:00 PM Re: Mcafee version number
Anonymous
Unregistered


Thanks a lot !!!
This is a really good BBS ( or whatever it is really)
Shawn... soory couldnt post code today.. we lost an entire site so I was away from my desk all day
Thabeck... looks really good but the reg keys you have I dont seem to find. are you running the corp edition, or what am i doing wrong ??

radimus.... This looks as tho its what I need but My users may be freeked by too many msgs. Uk NHS users also we dont use the same reg keys .


Many thanks for all yr input I will try to combine all answers to get one that suits me then post it for future ref.. Is that how its supposed to work ????


Keep up the ggod work !!!


Steve

Top
#6792 - 2001-02-10 04:28 PM Re: Mcafee version number
Anonymous
Unregistered


ARRRGGGHHH !
After all your hard work I make 1 change and the whole thing goes to bits.
I tried to make a different log file as the
sdat file is too large we hv 2000+ users.
all i wanted was the userid ver no. and time / date. And now i get errors , as i am new to Kix could someone give me a hand ... again sorry folks.

Heres the code from thabeck that I changed[code]
:McAfeeUpdate
? "Checking McAfee definition files"
; obtain DAT version on client system
$Result=Readvalue("Hkey_Local_Machine\Software\Network Associates\TVD\Shared Components\VirusScan Engine\4.0.xx","szDatVersion")
$ClientDATVer = (0 + SUBSTR($Result, LEN($Result) - 3, 4))

; obtain approved released DAT version
$Result = ReadProfileString("\\Server\LatestDATs$\config.ini", "VirusScan Engine", "VirusDefinition")
$AppDATVer = (0 + SUBSTR($Result, LEN($Result) - 3, 4))

; determine if SDAT needs to be launched
if $ClientDATVer < $AppDATVer
; DAT version on Client is older than that on the server - Run SDAT
$SDAT = ReadProfileString("\\Server\LatestDATs$\config.ini", "VirusScan Engine", "SDATFileName")
SHELL ("%comspec% /e:1024 /c Start /w \\Server\LatestDATs$\$SDAT /s")
else
; DAT version on Client is the same version or newer than that on the server - Do nothing
open(1,"\\server\latestdats$\datlog.txt",5)
writeline(1,"@userid,$appdatver” + @TIME + Chr(13) + Chr(10) )
Close(1)

endif


In anticipation...

Steve ( the foolish novice)

[This message has been edited by Guru (edited 11 February 2001).]

Top
#6793 - 2001-02-10 05:18 PM Re: Mcafee version number
Anonymous
Unregistered


oops sorry duplicate post

[This message has been edited by Guru (edited 11 February 2001).]

Top
Page 1 of 1 1


Moderator:  Jochen, Allen, Radimus, Glenn Barnas, ShaneEP, Ruud van Velsen, Arend_, Mart 
Hop to:
Shout Box

Who's Online
0 registered and 837 anonymous users online.
Newest Members
fgarcia, Viginette, ManuvdWielNL, Sir_Barrington, batdk82
17889 Registered Users

Generated in 0.051 seconds in which 0.023 seconds were spent on a total of 12 queries. Zlib compression enabled.

Search the board with:
superb Board Search
or try with google:
Google
Web kixtart.org