Turn Off Windows Firewall from the Command Line using netsh

To begin, open a command prompt as administrator.

To turn off Windows Firewall for Domain Networks type the following command:

netsh advfirewall set domain state off

To turn off Windows Firewall for Private Networks type the following command:

netsh advfirewall set private state off

To turn off Windows Firewall for Public Networks type the following command:

netsh advfirewall set public state off

To turn off Windows Firewall for All Networks (Domain, Private, Public) type the following command:

netsh advfirewall set allprofiles state off

Now, if you needed to turn Windows Firewall back on using this utility you can type the same commands and just change “off” to “on”. For example, if you wanted to turn the Windows Firewall on for all networks you would type the following command:

netsh advfirewall set allprofiles state on