Enabling all Rules on Windows Firewall in Windows 10 RRS feed

  • Question

  • Hi,

    How can I enable all Rules and ports on Windows Firewall using command prompt?


    Saturday, January 26, 2019 5:16 PM

All replies

  • Kindly go through the following:

    Enable or Disable Windows Firewall from Command Prompt

    S.Sengupta,Microsoft MVP Windows and Devices for IT, Windows Insider MVP

    Sunday, January 27, 2019 12:02 AM
  • Hi,


    To open ports in Windows Firewall using Command Prompt, please check the following command as reference. It opens ports 600o to 7000 for UDP outbound traffic:


    netsh advfirewall firewall add rule name="UDP ports" protocol=UDP dir=out localport=6000-7000 action=allow


    The command is quite long, but it’s fairly easy to break down. You add a rule, give it a name, choose the protocol (TCP or UDP), choose the direction (In or Out), give it the port number and choose the action (Allow or Deny).


    To enable  Windows Firewall rules using the command prompt, please run the following command and remember to replace name with the name of your rule. To disable change enable to no.


    netsh advfirewall firewall set rule name="TestRule" new enable=yes


    Hope these are helpful.

    Please remember to mark the replies as answers if they help.
    If you have feedback for TechNet Subscriber Support, contact

    Monday, January 28, 2019 2:15 AM