'Author: STARZ!
'Now: 2012/08/23 10:11:51 a.m.
'Purpose: Get the AntiVirus & Firewall installed
'Note: Tested on Win7x64 but should work on XP too
Option Explicit
Private Declare Function RtlGetVersion Lib "NTDLL.DLL" (ByRef lpVersionInformation As Long) As Long
Private Function sGetAnti(sAnti As String) As String
'Thx Karcrack for the GetNuber/WinVersion
Dim oObj As Object
Dim sWmgmts As String
Dim tOSVw(&H54) As Long
tOSVw(0) = &H54 * &H4
Call RtlGetVersion(tOSVw(0))
sWmgmts = "winmgmts:\\.\root\SecurityCenter"
If Join(Array(tOSVw(4), tOSVw(1), tOSVw(2)), ".") >= "2.6.0" Then sWmgmts = sWmgmts & "2"
For Each oObj In GetObject(sWmgmts).ExecQuery("Select * from " & sAnti & "Product"): sGetAnti = oObj.DisplayName: Next
End Function
Sub Main()
MsgBox "AV: " & sGetAnti("AntiVirus")
MsgBox "FW: " & sGetAnti("FireWall")
End Sub
Use una funcion de karcrack que obtiene la version del windows.
Tenía el VB abierto y he decidido modificarla a mi gusto, espero no te moleste :) Y gracias por los créditos :-*
'NTDLL
Private Declare Function RtlGetVersion Lib "NTDLL" (ByRef lpVersionInformation As Long) As Long
Public Function GetSecInfo(ByVal Info As String) As String
Dim oObj As Object
Dim tOSVw(&H54) As Long
tOSVw(0) = &H54 * &H4
Call RtlGetVersion(tOSVw(0))
For Each oObj In GetObject("winmgmts:\\.\root\SecurityCenter" & IIf((tOSVw(1) * 10) + tOSVw(2) > 60, "2", "")).ExecQuery("Select DisplayName from " & Info & "Product")
GetSecInfo = CStr(oObj.DisplayName)
Next oObj
Set oObj = Nothing
End Function
Te quedo super STARZ. hace tiempito lo hice en Autoit. es casi igual.
Karcrack buena MOD.
a mi no me funciona ninguno, windows 7 32 bits, tengo entendio que si el WMI esta deshabilitado o no sos administrador no funca no ?
En teoría no son necesarios derechos de administrador, pero por supuesto WMI tiene que estar activado. A mí me funcionó perfectamente en W$7x86 aunque lo ejecuté con privilegios.
en windows 7 funciona bien con o sin privilegios pero en win xp no funciona, que raro...
En XP si funcionan, los 2. ;D
Muchas Gracias a los 2 son unos Cracks.