summaryrefslogtreecommitdiff
path: root/antivirusDetection.vbs
blob: ad22e267343d22f2eef65b41544b3c74a736f0e4 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
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
/tr> 2019-03-15loplugin:typedefparamStephan Bergmann 2019-02-10loplugin:indentation in soltools..svlNoel Grandin 2019-02-06loplugin:flatten in soltoolsNoel Grandin 2018-11-29Rename Mac OS X to official name macOS in comments and documentationBartosz Kosiorek 2018-11-22remove some unused enum values and defines in soltoolsNoel Grandin 2018-11-22remove unused toktype::IDENTNoel Grandin 2018-11-07loplugin:collapseif in sdext..svxNoel Grandin 2018-10-22loplugin:staticvar in soltools..svxNoel Grandin 2018-10-09loplugin:constfields in smoketest..sotNoel Grandin 2018-10-04Avoid -Werror=stringop-truncationStephan Bergmann 2018-09-18loplugin:external (in non-Linux code)Stephan Bergmann 2018-09-16loplugin:external in Executable_cppStephan Bergmann 2018-07-27Related: rhbz#1602589 silence leaked_storageCaolán McNamara 2018-01-25Fix typosAndrea Gelmini 2017-12-07loplugin:constparamsNoel Grandin 2017-10-24loplugin:includeform: soltools (macOS)Stephan Bergmann 2017-09-25Translate German comments and debug strings (leftovers)Johnny_M 2017-08-21Make cpp cope with long source linesStephan Bergmann 2017-08-14new loplugin:droplongNoel Grandin 2017-08-10tdf#39468: Translate some german commentsChristian Barth 2017-07-21loplugin:constparams in soltools and variousNoel Grandin 2017-07-06Translate German comments/debug strings (leftovers in dirs sdext to soltools)Johnny_M 2017-07-03loplugin:unusedfields in slideshow..svtoolsNoel Grandin 2017-03-22Fix passing plain char into ctype.h is* functionsStephan Bergmann 2017-03-19fix typo/grammar: "the the" --> thedennisroczek 2017-01-26-Werror=implicit-fallthrough= (GCC 7)Stephan Bergmann 2017-01-09loplugin:externvarStephan Bergmann