Open PowerShell in admin mode and type below command.
set-NetFirewallRule -DisplayGroup "File And Printer Sharing" -Enabled True -Profile Any