On newer windows,
netsh advfirewall set allprofiles state off/on
:: or equivalently
netsh advfirewall set privateprofile state off/on
netsh advfirewall set publicprofile state off/on
netsh advfirewall set domainprofile state off/on
On older ones,
netsh advfirewall set publicprofile state off/on