If you want to do this using a command line that is pretty easy and simple. you can enable or turn off the windows firewall settings using the command line as well as from the control panel.
How To Enable Firewall Using Command Line:
Use the below command to check whether the firewall is enabled or not using the command line but run the command prompt using administrator otherwise command won’t run.
netsh advfirewall show allprofiles
Firewall‘s used to protect the internal network from outside the world. If you keep the firewall “ON” it will protect your system accessing from the outside the world. you can also use wf.msc to open the window defender firewall GUI from the command line.
You can use windows firewall's built-in features in windows or you can use antivirus to protect your system.
Here I’m going to show you how to do this.
Now I’m going to stop the firewall using the command line and run this command by login as administrator.
netsh firewall set opmode disable
If you want to enable use this command
netsh firewall set opmode enable
That’s it enable firewall windows windows firewall settings windows firewall command line