Wednesday, March 18, 2015

Enabling/Disabling the firewall using command line

फायरवाल को इनेबल या डिसेबल करना








With the command line
First open the command prompt: (Windows + R keys) and type : cmd
o    netsh firewall set opmode disable
o    netsh firewall set opmode enable

Validate with the Enter key.
With a.BAT file
It is also possible to create a batch file (with extension. Bat) incorporating one of these command to enable or disable the firewall by simply double-clicking.

You can create a batch file to enable or disable the firewall by double-clicking on Notepad and inserting one of two lines above, then saving the file with the .bat extension (ex: Activatefirewall.BAT).


To go further you can create two files on the desktop, to enable and disable the firewall:
  • Click on Start/All Programs/Accessories/Notepad (or Start/Run/notepad/[OK])
  • Add the command:
o    netsh firewall set opmode disable
  • Click on File/Save As
  • In "File name" write "Disablefirewall.BAT"
  • Save directly on your desktop
  • Double-click this file to disable the firewall in Windows XP
  • Repeat the above operation, but now using the command
o    netsh firewall set opmode enable
  • In "File name" write "Activatefirewall.BAT"
  • Save directly on your desktop
  • Double-click this file to activate the firewall in Windows XP



This article explains how you can quickly Turn Windows Firewall On or Off. This tips applies to Windows Vista, Windows 7 and Windows Server 2008 only!

Windows Firewall on computers running Windows Vista, Windows 7 and Windows Server 2008 is enabled by default. You may need turn it off for various reasons.
This is how you do it using a command prompt:
  • To Turn Off: 
  • NetSh Advfirewall set allprofiles state off
  • To Turn On: 
  • NetSh Advfirewall set allrprofiles state on
  • To check the status of Windows Firewall: 
  • Netsh Advfirewall show allprofiles

 

No comments:

Post a Comment