netsh firewall set icmpsetting 8
To disable the same,
netsh firewall set icmpsetting 8 disable
Make sure you open command prompt as an Administrator.
Netsh is the command line utility available in windows command prompt (DOS box) to help with network configuration. See here for more on netsh.
The above settings can also be set in windows firewall settings GUI (screen) in control panel. Surprisingly it's a little more convoluted. See here