Howto: See if a local port is listening from command prompt

List local/remote socket and PID  for all TCP connections in “Established” state:

netstat -ano | find /i "established"

List local/remote socket for all TCP connections in “Established” state (sometimes you get more than above):

netstat -an | find /i "established"

List connections over time (netstat_check_connections.bat):

@echo off
for /L %%X in (1,1,4) do (netstat -b >> C:\connections.txt)&(PING 127.0.0.1 -n 1 -w %5 2>NUL | FIND "TTL=" >NUL)

For other great command line kung foo check out synjunkie

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.