This worked for me when I used to have the issue:
WINDOWS 8 / WINDOWS 8.1
1. Navigate to the Control Panel.
2. Select Systems and Security, and then Windows Firewall.
3. Click Advanced Settings on the left.
4. From the left pane of the resulting window, click Inbound Rules.
5. In the right pane, find the rules titled File and Printer Sharing (Echo Request - ICMPv4-In).
6. Right-click each rule and choose Enable Rule.
WINDOWS 7
1. From the Start menu, search for Windows Firewall with Advanced Security. Click it to bring up the application.
2. From the left pane, click Inbound Rules.
3. In the right pane, find the rules titled File and Printer Sharing (Echo Request - ICMPv4-In).
4. Right-click each rule and choose Enable Rule.