Skip to content
Home » Windows » How to Disable Windows Firewall by Command

How to Disable Windows Firewall by Command

Turn off Windows Firewall

We have learned about how to open port on windows firewall simply by commands in previous post. In this one, we'll learn how to turn off windows firewall within all scope of profiles by commands.

First of all, we open a command prompt in elevated mode (run as administrator), then input the following command.

C:\Users\Administrator>netsh advfirewall set allprofiles state off
Ok.

ALLPROFILES includes public, private and domain, 3 profiles.

When an "Ok" returned, we can check the status of windows firewall in this machine.

C:\Users\Administrator>netsh advfirewall show all

Domain Profile Settings:
----------------------------------------------------------------------
State                                 OFF
Firewall Policy                       BlockInbound,AllowOutbound
LocalFirewallRules                    N/A (GPO-store only)
LocalConSecRules                      N/A (GPO-store only)
InboundUserNotification               Disable
RemoteManagement                      Disable
UnicastResponseToMulticast            Enable

Logging:
LogAllowedConnections                 Disable
LogDroppedConnections                 Disable
FileName                              %systemroot%\system32\LogFiles\Firewall\pfirewall.log
MaxFileSize                           4096


Private Profile Settings:
----------------------------------------------------------------------
State                                 OFF
Firewall Policy                       BlockInbound,AllowOutbound
LocalFirewallRules                    N/A (GPO-store only)
LocalConSecRules                      N/A (GPO-store only)
InboundUserNotification               Disable
RemoteManagement                      Disable
UnicastResponseToMulticast            Enable

Logging:
LogAllowedConnections                 Disable
LogDroppedConnections                 Disable
FileName                              %systemroot%\system32\LogFiles\Firewall\pfirewall.log
MaxFileSize                           4096


Public Profile Settings:
----------------------------------------------------------------------
State                                 OFF
Firewall Policy                       BlockInbound,AllowOutbound
LocalFirewallRules                    N/A (GPO-store only)
LocalConSecRules                      N/A (GPO-store only)
InboundUserNotification               Disable
RemoteManagement                      Disable
UnicastResponseToMulticast            Enable

Logging:
LogAllowedConnections                 Disable
LogDroppedConnections                 Disable
FileName                              %systemroot%\system32\LogFiles\Firewall\pfirewall.log
MaxFileSize                           4096

Ok.

As we can see, Windows Firewall is off.

Leave a Reply

Your email address will not be published. Required fields are marked *