HOWTO: Find virus info with NOD32 in hMailServer

Use this forum if you have installed hMailServer and want to ask a question related to a production release of hMailServer. Before posting, please read the troubleshooting guide. A large part of all reported issues are already described in detail here.
Post Reply
User avatar
Normal user
Normal user
Posts: 46
Joined: 2006-09-07 21:14

HOWTO: Find virus info with NOD32 in hMailServer

Post by Pern » 2006-11-30 18:38

i have an event log im using and i wanted to see if a virus not only is passed but what the info that nod32 found as well, so i played a bit with the script file i was using for the event log and i came up with this.

NOTE: You must save the nod32 logs to the below path
my anti virus value is
"C:\Program Files\ESET\nod32.exe" /pattern+ /heur+ /scanboot- /scanmbr- /scanmem- /arch+ /sfx+ /pack+ /list- /sound- /subdir- /expire- /selfcheck- /quit+ /logrewrite /log=C:\PROGRA~1\hMailServer\Logs\Nod32\NOD32.log "%FILE%"

Code: Select all

   Dim fso, MyFile, ReadLineTextFile
   Set fso = CreateObject("Scripting.FileSystemObject")
   Set MyFile = fso.OpenTextFile("C:\Program Files\hMailServer\Logs\Nod32\NOD32.log", 1,false)
   Do While MyFile.AtEndOfStream <> True
     ReadLineTextFile = MyFile.ReadLine
     'look for and stores a line with .zip text
     If instr(1,ReadLineTextFile,"»ZIP",vbTextCompare) > 0 then
        SaveLine = ReadLineTextFile
     End If
     'looks for number of viruses found >0
     If left(ReadLineTextFile,24 )="Number of threats found:" then
       NumFound = int(trim(right(ReadLineTextFile,len(ReadLineTextFile)-24)))
       if NumFound > 0 then
            str1 = mid(SaveLine,instr(1,SaveLine,"»ZIP"),instr(1,SaveLine," - ") - instr(1,SaveLine,"»ZIP"))
            str2 = right(SaveLine,len(SaveLine) - instr(1,SaveLine," - ") - 2)
               msgbox "Virus_Info = " & str1 & vbCRLF & "Virus_Discription = "& str2
               msgbox "No threats found"
       End If
     End If
my code im using is a bit different, but its basically the same.

Hope others find this usefully. i may make a more detailed how-to later on how i did the event log and other info ive done. i was building a support site, with things ive done, but ive recently changed my work and don't have time to build it any longer (maybe some other time)
Johnny - aka Pern
WebSite: ** Happy Holidays**

Post Reply