Enable ping in Windows 7 firewall?

The problem is copy and paste. With the right quotation marks

netsh advfirewall firewall add rule name="ICMP Allow incoming V4 echo request"
    protocol=icmpv4:8,any dir=in action=allow

does the job. I'm not sure from which source I copied the problematic version.


When I typed:

netsh advfirewall firewall add rule name="Enable Echo Ping Request" protocol=icmpv4:8,any dir=in action=allow

into my Windows PowerShell ISE, I got an error: "A specified protocol value is not valid."

I fixed it by using this:

netsh advfirewall firewall add rule name="Enable Echo Ping Request" protocol="icmpv4:8,any" dir=in action=allow

Control Panel --> System and Security --> Windows Firewall --> Advanced settings --> right click on Inbound rules --> New rule --> Custom rule -> Next

In Protocol and ports (chosen in the left panel): Protocol: ICMPv4

In the same panel, press button Customize, choose "Specific ICMP types", check the box "Echo Request", and press button OK.

In Name (chosen in the left panel): fill in the Name field and press Apply.