Wednesday, December 3, 2008

How to check the port status (Using Netstat)

Open Command Prompt (Click 'Start' --> Run --> Type 'cmd' --> Press 'Enter')

To get the status of all port, give the below command:

netstat -aon


You will get a result like this
-------------------------------

Active Connections

Proto Local Address Foreign Address State PID

TCP 0.0.0.0:1110 0.0.0.0:0 LISTENING 296
TCP 127.0.0.1:1028 0.0.0.0:0 LISTENING 792
TCP 127.0.0.1:1037 127.0.0.1:1038 ESTABLISHED 684
TCP 127.0.0.1:1039 127.0.0.1:1040 ESTABLISHED 1944

Comparing the PID number with that in the Task Manager, you can find which application is listening to a specific port.

:-)