Windows has Connection profiles like "Private", and "Guest or Public" which manages if you can ping windows, or not.
You can see which profile is enabled for you with:
Control Panel\Network and Internet\Network and Sharing Center
and click "Advanced sharing settings"
There you see wheter the "Private" or the "Guest or Public" Profile is enabled.
Beside the enabled Profile name is (current profile), that marks it as active.
Inside the Profile enable "File and Printer sharing". And click "Save changes"
The "Guest or Public" profile is set to not respond to ping per default.
The "Private" profile responds to the ping by default.
To set the Connection Profile with powershell (in elevated mode) to Private use:
Set-NetConnectionProfile -InterfaceAlias "*" -NetworkCategory Private