From LedHed's Wiki
Jump to: navigation, search
 
(4 intermediate revisions by the same user not shown)
Line 1: Line 1:
'''How to disable the XP firewall from the commandline'''
+
'''How to disable the Windows firewall from the commandline'''
  
There are many Network Administration tasks that can't be accomplished when the XP Firewall is enabled. Since the release of XP SP2 the Firewall is enabled by default. Here is a way to disable the firewall from the commandline which can be very usefull.
+
There are many Network Administration tasks that can't be accomplished when the Windows Firewall is enabled. Since the release of XP SP2 the Firewall is enabled by default. Here is a way to disable the firewall from the commandline which can be very usefull.
  
 
== Prerequisites ==
 
== Prerequisites ==
 
You must have access to the PC you want to disable the Firewall on.<br>
 
You must have access to the PC you want to disable the Firewall on.<br>
Possible options: Local access, a remote shell like telnet, or you must have admin access to the computer and be on another computer within the same subnet.<br>
+
Possible options: Local access, a remote shell like telnet, or you must have admin access to the computer and be on another computer within the same subnet (this requires PSEXEC).<br>
  
== Checking the Firewall Status ==
 
The 'SC' command allows us to check the firewall status.
 
From Local Shell
 
sc firewall show opmode
 
From Remote Shell
 
sc \\RemoteHostname firewall show opmode
 
  
== Disabling the Firewall ==
+
== XP ==
From Local Shell
+
=== Checking the Firewall Status ===
  sc firewall set opmode DISABLE
+
The 'NetSH' command allows us to check the firewall status.
From Remote Shell
+
  netsh firewall show opmode
  sc \\RemoteHostname firewall set opmode DISABLE
+
 
 +
 
 +
=== Disabling the Firewall ===
 +
netsh firewall set opmode DISABLE
 +
 
 +
=== Enabling the Firewall ===
 +
  netsh firewall set opmode ENABLE
 +
 
 +
 
 +
== Windows 7 ==
 +
=== Checking Firewall Status ===
 +
netsh advfirewall show profiles state
 +
Where ''profiles'' is '''AllProfiles''', '''CurrentProfile''', '''DomainProfile''', '''PrivateProfile''', or '''PublicProfile'''.
 +
 
 +
 
 +
=== Disabling the Firewall ===
 +
netsh advfirewall set profiles state off
 +
 
 +
 
 +
=== Enabling the Firewall ===
 +
netsh advfirewall set profiles state on
 +
 
  
== Enabling the Firewall ==
 
From Local Shell
 
sc firewall set opmode ENABLE
 
From Remote Shell
 
sc \\RemoteHostname firewall set opmode ENABLE
 
  
 
== Notes ==
 
== Notes ==
1) You can also disable the XP Firewall via Group Policy is your computers are on a Windows 2000+ domain.
+
1) You can also disable the Windows Firewall via Group Policy if your computers are on a Windows 2000+ domain.
 +
 
 +
 
 +
[[Category:Remote_Admin_Tricks]]

Latest revision as of 23:58, 23 May 2012

How to disable the Windows firewall from the commandline

There are many Network Administration tasks that can't be accomplished when the Windows Firewall is enabled. Since the release of XP SP2 the Firewall is enabled by default. Here is a way to disable the firewall from the commandline which can be very usefull.

Prerequisites

You must have access to the PC you want to disable the Firewall on.
Possible options: Local access, a remote shell like telnet, or you must have admin access to the computer and be on another computer within the same subnet (this requires PSEXEC).


XP

Checking the Firewall Status

The 'NetSH' command allows us to check the firewall status.

netsh firewall show opmode


Disabling the Firewall

netsh firewall set opmode DISABLE

Enabling the Firewall

netsh firewall set opmode ENABLE


Windows 7

Checking Firewall Status

netsh advfirewall show profiles state

Where profiles is AllProfiles, CurrentProfile, DomainProfile, PrivateProfile, or PublicProfile.


Disabling the Firewall

netsh advfirewall set profiles state off


Enabling the Firewall

netsh advfirewall set profiles state on


Notes

1) You can also disable the Windows Firewall via Group Policy if your computers are on a Windows 2000+ domain.