vbs script output to csv format

Microsoft Windows xp professional w/serv...
September 28, 2010 at 03:43:44
Specs: Windows XP, 256
Hai guys////////


i have a script whch shows antivirus version of a PC which download from net... this is a vbs script which shows antivirus version output to screen... can u suggest any idea how to take the output of this file in CSV format.. so that upload it into Database!!!!!!!!!!!

strComputer = "."
Set objWMIService = GetObject("winmgmts:" _
& "{impersonationLevel=impersonate}!\\" _
& strComputer & "\root\SecurityCenter")

Set colItems = objWMIService.ExecQuery _
("Select * from AntiVirusProduct")

For Each objItem in colItems
Wscript.Echo "Company Name: " _
& objItem.companyName
Wscript.Echo "Display Name: " _
& objItem.displayName
Wscript.Echo "Version Number: " _
& objItem.versionNumber
Wscript.Echo "Instance GUID: " & _
objItem.instanceGuid
Wscript.Echo "Product Upto Date: " _
& objItem.productUptoDate

thanks in advance

regards


See More: vbs script output to csv format

Report •

#1
September 30, 2010 at 07:30:42
The script you posted is missing at least one line, and will not run as posted. Also, neither this script nor the one you posted will work on any pre-WinXP SP2 machines.

Set colItems = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\SecurityCenter").ExecQuery("Select * from AntiVirusProduct")
With CreateObject("Scripting.FileSystemObject").OpenTextFile("av.csv", 8, True)
  For Each objItem in colItems
    .WriteLine """" & objItem.companyName & """,""" & _
      objItem.displayName & """,""" & _
      objItem.versionNumber & """,""" & _
      objItem.instanceGuid & """,""" & _
      objItem.productUptoDate & """"
  Next 'objItem
End With


Report •
Related Solutions


Ask Question