In many situations you want to turn off Windows Firewall may be because of some software is not working because of blocked ports or to test some other things which requires a free communication. There can be several reasons for this.
In latest service packs netsh firewall has been depreciated and you need to use netsh advfirewall firewall command.
To turn off the firewall use :
netsh advfirewall set currentprofile state off
and to turn on the Firewall back use :
netsh advfirewall set currentprofile state on
No need to tell that you will be required to execute above commands in Admin mode.
There is a long list of such commands available at Microsoft website which show the conversion of commands from depreciated netsh firewall to netsh advfirewall firewall. For detail visit below URL :