Lists all globally-open ports for the Windows Firewall current profile
Set objFirewall = CreateObject("HNetCfg.FwMgr")Set objPolicy = objFirewall.LocalPolicy.CurrentProfileSet colPorts = objPolicy.GloballyOpenPortsFor Each objPort in colPortsWscript.Echo "Port name: " & objPort.NameWscript.Echo "Port number: " & objPort.PortWscript.Echo "Port IP version: " & objPort.IPVersionWscript.Echo "Port protocol: " & objPort.ProtocolWscript.Echo "Port scope: " & objPort.ScopeWscript.Echo "Port remote addresses: " & objPort.RemoteAddressesWscript.Echo "Port enabled: " & objPort.EnabledWscript.Echo "Port built-in: " & objPort.BuiltinNext
This is a VB Script, this can be used by saving the file in .vbs file