加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
文件
克隆/下载
antivirusDetection.vbs 1.11 KB
一键复制 编辑 原始数据 按行查看 历史
rtlhq 提交于 2023-09-20 15:15 . Import Upstream version 7.4.7
On Error Resume Next
Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\SecurityCenter2")
If objWMIService is Nothing Then
Wscript.StdOut.Write "NULL"
Else
Set installedAntiviruses = objWMIService.ExecQuery("Select * from AntivirusProduct")
'Iterates through all the antivirus software,retrieved by the WMI query,present on the system and prints only the ones that are active
'this is done by checking the 12th bit of the productState property of the antivirus
'if 12th bit is on then it means that the antivirus is in active state
'if 12th bit is off then it is inactive.
'see http://neophob.com/2010/03/wmi-query-windows-securitycenter2/
count=0
list=""
For Each antivirus in installedAntiviruses
If antivirus.productState And &h01000 Then 'checking the state of the 12th bit of productState property of the antivirus
count=count+1
list=list & VBNewLine & VBtab & "*" & antivirus.displayName
End if
Next
If count = 0 Then
Wscript.StdOut.Write "NOT_FOUND"
Else
Wscript.Echo list
End if
End if
Loading...
马建仓 AI 助手
尝试更多
代码解读
代码找茬
代码优化