You might be able to use the WMI to detect if the firewall software is running (though I don't know if this detects all firewalls, and it may only work on XP+):
VB6 Code:
VB Code:
Private Sub DumpFirewallInfo() Dim oLocator As WbemScripting.SWbemLocator Dim oService As WbemScripting.SWbemServicesEx Dim oFirewalls As WbemScripting.SWbemObjectSet Dim oFirewall As WbemScripting.SWbemObjectEx Dim oFwMgr As Variant Set oFwMgr = CreateObject("HNetCfg.FwMgr") Debug.Print "Checking the Windows Firewall..." Debug.Print "Windows Firewal Enabled: " & oFwMgr.LocalPolicy.CurrentProfile.FirewallEnabled Debug.Print "" Set oFwMgr = Nothing Debug.Print "Checking for other installed firewalls..." Set oLocator = New WbemScripting.SWbemLocator Set oService = oLocator.ConnectServer(".", "root\SecurityCenter") oService.Security_.ImpersonationLevel = 3 Set oFirewalls = oService.ExecQuery("SELECT * FROM FirewallProduct") ' This could also be "AntivirusProduct" For Each oFirewall In oFirewalls Debug.Print "Company: " & vbTab & oFirewall.CompanyName Debug.Print "Firewall Name: " & vbTab & oFirewall.DisplayName Debug.Print "Enabled: " & vbTab & Format$(oFirewall.Enabled) Debug.Print "Version: " & vbTab & oFirewall.versionNumber Debug.Print "" Next oFirewall Set oFirewall = Nothing Set oFirewalls = Nothing Set oService = Nothing Set oLocator = Nothing End Sub Private Sub Command1_Click() DumpFirewallInfo End Sub
Credit where credit is due: http://www.experts-exchange.com/Prog..._21645145.html




Reply With Quote