Force close an open port in Windows Server 2003

5,841

This rule has enough information to make a port rule on the WS2K8 system. Within netsh, this rule would be entered as:

netsh advfirewall firewall add rule name="3306" protocol=TCP dir=in localport=3306 action=block

Share:
5,841

Related videos on Youtube

Ueli
Author by

Ueli

Updated on September 17, 2022

Comments

  • Ueli
    Ueli almost 2 years

    On a server running Windows Server 2003 I killed the TS-service (specifically the svchost.exe which belongs to terminal services).

    The service is not running anymore but the server is still listening on port 3306 (as is seen by running netstat -a).

    How can I force this port closed?

  • Ueli
    Ueli over 13 years
    Thank you. I just want to close it one time so that I can start the TS-Service. Your solution seems to block it forever.
  • Ov's Pianist
    Ov's Pianist about 13 years
    Sounds good, but TS isn't restartable in 2003. Wonder why killing the service was necessary... (wonder what the real-real problem is)
  • db2
    db2 about 13 years
    Yeah, normally it's MySQL that uses 3306 by default.