Check Symantec Virus Def Date

Posted Wednesday, July 4, 2007 in Old JamesCMS Posts

Want a quick way to check the Symantec virus definition date of a remote computer? Well a quick registry script may be the answer.

{{VBScript}}
dim objShell, strComputer, oReg, strKeyPath, strvalueName, stringValue
Set objShell = WScript.CreateObject("WScript.Shell")

On Error Resume Next

const HKEY_LOCAL_MACHINE = &H80000002
strComputer = InputBox("Computer name here", "James", , 500, 500)
set oReg = GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & strComputer & "\root\default:StdRegProv")
strKeyPath = "SOFTWARE\Symantec\SharedDefs"
strValueName = "DEFWATCH_10"

oReg.GETStringValue HKEY_LOCAL_MACHINE, strKeyPath, strValueName, stringValue

Dim objVer, objRev, objDate, objYear, objMonth, objDay, objNDate

objVer = Right(stringValue, 12)
objRev = Right(objVer, 3)
objDate = Left(objVer, 8)
objYear = Left(objDate, 4)
objMonth = Mid(objDate, 5, 2)
objDay = Right(objDate, 2)
objNDate = CDATE(objMonth & "/" & objDay & "/" & objYear)

WScript.Echo strComputer & ": Virus Def Date - " & objNDate & " Rev - " & objRev