Disable Windows Firewall via CMD
It’s pretty common that in any given week, I must access a customer’s server and disable their firewall. The firewall could have been misconfigured, they could have set their Network Location to being “Public” or changed it to “Private” while having a separate set of rules for that location, whatever the case may be, Commandline is the only ticket for us.
To cut straight to it:
netsh firewall set opmode disable
or
NetSh Advfirewall set allprofiles state off
I put two different methods of turning the Firewall Off. “netsh firewall” is the old method that seems to still work and has been time tested for me, whereas Advfirewall is the new method and the supposed “right way” to do it. I on the otherhand have never found that the old way has failed, but only time will tell.