Is it possible to check the status of the windows-firewall? (aktiv or
inaktive)
The following seems to do it - only limited testing though.
Private Function FireWallIsEnabled()
' return true if windows firewall is enabled
' requires option strict off (late binding)
Dim enabled As Boolean
Try
Dim fwMgr As Object = CreateObject("HNetCfg.FwMgr")
Dim profile As Object = fwMgr.LocalPolicy.CurrentProfile
Dim fwe As Integer = profile.FirewallEnabled
enabled = (fwe <> 0)
Catch ex As Exception
enabled = False ' indicate disabled if any error
End Try
Return enabled
End Function