Add Ports to Windows Firewall

By ET

To add a range of ports to Windows Firewall from the Command Line

  1. Start Command Line
  2. Type in the following where the range is specified in ( ) and the name of the firewall entry is in ” “.
    FOR /L %I IN (5001,1,5010) DO netsh firewall add portopening TCP %I “PassiveFTP”%I
  3. Each port in the range will be added with an “OK” confirmation.

  1. 2
    Salsa Says:

    I found this incredibly useful for setting up passive ftp with the 2003 server and windows firewall. Thanks very much :)

    Am I right in thinking that i can substitute portopening for portclosing and have the opposite effect? Or is it more complicated than that?

  2. 1
    ET Says:

    Haven’t written anything for two months. This is crazy.

Leave a Reply


BlogTimer
You are visitor number several since September 1, 2001

Copyright Xiaoquan (Michael) Zhang, 2004-2007. All rights reserved.
All trademarks property of their owners.