Java Is it possible to programmatically determine whether the Windows anti-virus solution is being updated?

Is it possible to determine programmatically whether the Windows anti-virus solution is updated in Java?

+4
source share
2 answers

You can use the productUptoDate property of the WMI class of the AntiVirusProduct class. Here you have examples (in C # and Delphi) of use and location (the namespace depends on the version of Windows) of this class.

to access the WMI service with Java you can use jinterop or jWMI

+7
source

This is the VBScript used by our company - it uses WMI as a Niklas B. solution, so it will only work on XP SP3 +. It uses the same provider as Windows Security Center (which does not always select every AV solution! However, it does provide a lot of information about the AV solution.

 Set objSWbemServices = GetObject("winmgmts:\\.\root\SecurityCenter") Set colFirewall = objSWbemServices.ExecQuery("Select * From antivirusProduct",,48) For Each objAntiVirusProduct In colFirewall WScript.Echo "companyName: " & objAntiVirusProduct.companyName WScript.Echo "displayName: " & objAntiVirusProduct.displayName WScript.Echo "instanceGuid: " & objAntiVirusProduct.instanceGuid WScript.Echo "onAccessScanningEnabled: " & objAntiVirusProduct.onAccessScanningEnabled WScript.Echo "productUptoDate: " & objAntiVirusProduct.productUptoDate WScript.Echo "versionNumber: " & objAntiVirusProduct.versionNumber Next 

Good luck and happy coding!

+2
source

Source: https://habr.com/ru/post/1403189/


All Articles