diff options
author | Michel Thomas <michelphoenix98@gmail.com> | 2020-02-02 01:03:20 +0530 |
---|---|---|
committer | Mike Kaganski <mike.kaganski@collabora.com> | 2020-02-08 06:17:03 +0100 |
commit | c16969b9bc73fdd77e763299d6aea7b614e203e2 (patch) | |
tree | 4d73ef247be39d4a5238e362951de3c0858a4c49 /antivirusDetection.vbs | |
parent | 1d7b1a15059a77fde9afa14d0b9a508142bfc247 (diff) |
tdf#84553 Detect and warn of Windows Antivirus.
Change-Id: I7731cb316306c153ad14bb3d27f39600a44ed9ee
Reviewed-on: https://gerrit.libreoffice.org/c/core/+/87811
Reviewed-by: Julien Nabet <serval2412@yahoo.fr>
Tested-by: Jenkins
Diffstat (limited to 'antivirusDetection.vbs')
-rwxr-xr-x | antivirusDetection.vbs | 19 |
1 files changed, 19 insertions, 0 deletions
diff --git a/antivirusDetection.vbs b/antivirusDetection.vbs new file mode 100755 index 000000000000..a4e76731f0b6 --- /dev/null +++ b/antivirusDetection.vbs @@ -0,0 +1,19 @@ +Set objWMIService = GetObject("winmgmts:{impersonationLevel=impersonate}!\\.\root\SecurityCenter2")
+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
|