Share via


Allowing Incoming Echo Requests

This example shows how to allow incoming echo requests.

' Open up ICMP type 8 in the firewall (Allow Incoming Echo Requests)

Option Explicit

'Declare variables
' Create the firewall manager object.
Dim fwMgr
Set fwMgr = CreateObject("HNetCfg.FwMgr")

' Get the current profile for the local firewall policy.
Dim profile
Set profile = fwMgr.LocalPolicy.CurrentProfile

profile.IcmpSettings.AllowInboundEchoRequest = TRUE

'Use this line if you want to disable the setting.
'profile.IcmpSettings.AllowInboundEchoRequest = FALSE