read McAfee last virus update date from registry

All questions related to installations, configurations and maintenance of Advanced Host Monitor (including additional tools such as RMA for Windows, RMA Manager, Web Servie, RCC).
Post Reply
menno
Posts: 158
Joined: Fri May 21, 2010 1:27 am

read McAfee last virus update date from registry

Post by menno »

Hi team
i want to read the McAfee last AVDatDate update from the registry
I had some issues with my script.

I found this link but that did not help me :-?
http://www.ks-soft.net/cgi-bin/phpBB/vi ... tune+reply

the start cmd line :
cmd /c cscript /B /E:JScript %Script% %Params%
The script:
Script:
const statusUnknown = "scriptRes:Unknown:"
const statusOk = "scriptRes:Ok:"
const statusBad = "scriptRes:Bad:"

Dim tZ, uKey, shell, lastUp
dim dateValue
tZ = 0 'time relative to GMT
uKey ="HKLM\SOFTWARE\WOW6432Node\McAfee\AVEngine\AVDatDate"
Set shell =CreateObject("WScript.Shell")
lastUp = shell.RegRead (uKey)
dateValue = DateAdd ("h",tZ,(DateAdd("s",lastUp,"01/01/1970 00:00:00")))

WScript.StdOut.Write statusOk & dateValue
i get as result :
[10:37:18] Agent: XXXXX is going to execute "Last McAfee Update" script ...
[10:37:18] Script started, no results received

Can you please help me out here ?
many thanks in advance
menno
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

If you need to check single registry value, HostMonitor offers Registry test method.
[10:37:18] Agent: XXXXX is going to execute "Last McAfee Update" script ...
[10:37:18] Script started, no results received
Looks like script fails for some reason.
Try to start it from command line without /B option, you should see error description

Regards
Alex
menno
Posts: 158
Joined: Fri May 21, 2010 1:27 am

Post by menno »

thanks Alex

if i DO NOT use the /B option i get this:
[16:50:54] Agent: xxxxxx is going to execute "Last McAfee Update" script ...
[16:50:54] Script started, invalid result received:
----------
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Windows\TEMP\TMP-48~1.BAT(1, 8 ) Microsoft JScript compilation error: Expected ';'
----------
my new script is here:
Option Explicit

const statusAlive = "scriptRes:Host is alive:"
const statusDead = "scriptRes:No answer:"
const statusUnknown = "scriptRes:Unknown:"
const statusNotResolved = "scriptRes:Unknown host:"
const statusOk = "scriptRes:Ok:"
const statusBad = "scriptRes:Bad:"
const statusBadContents = "scriptRes:Bad contents:"


Dim tZ, uKey, shell, lastUp
dim dateValue
tZ = 0 'time relative to GMT
uKey ="HKLM\SOFTWARE\WOW6432Node\McAfee\AVEngine\AVDatDate"
Set shell =CreateObject("WScript.Shell")
lastUp = shell.RegRead (uKey)
dateValue = DateAdd ("h",tZ,(DateAdd("s",lastUp,"01/01/1970 00:00:00")))

WScript.StdOut.Write statusOk & dateValue
can you please help me out here
thx
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

btw: why you are trying to start VB Script using JScript (Java script) command line option?

Regards
Alex
menno
Posts: 158
Joined: Fri May 21, 2010 1:27 am

Post by menno »

thx alex
if i use : cmd /c cscript /E:VBScript %Script% %Params%
i still get

[17:17:20] Agent: xxxxx is going to execute "Last McAfee Update" script ...
[17:17:21] Script started, invalid result received:
----------
Microsoft (R) Windows Script Host Version 5.8
Copyright (C) Microsoft Corporation. All rights reserved.

C:\Windows\TEMP\TMP-29~1.BAT(18, 1) Microsoft VBScript runtime error: Type mismatch: '[string: "2016/06/22"]'
----------
KS-Soft
Posts: 13012
Joined: Wed Apr 03, 2002 6:00 pm
Location: USA
Contact:

Post by KS-Soft »

>i still get
As I see you get different error - Type mismatch: '[string: "2016/06/22"]'

Probably here?
DateAdd("s",lastUp,"01/01/1970 00:00:00") while lastUp = "2016/06/22"
You read "2016/06/22" from the registry? and then trying to use this string instead of number that should represent seconds?

Regards
Alex
Post Reply