Sunday, December 14, 2008

How to find what application is using your port ?

Often in a server side application developement we come across a situation where a service is booted up on a port assuming that it would be available and the application crashes as the port would be used by some other application. On a Windows XP SP3, the widely used version of OS from Microsoft, it is relatively easy to find if a port is available before opening it for service. It is even possible to identify the application that is using the specified port.
WinXP comes bundled with command line utilities like netstat and tasklist which can be effectively used in identifying the process/application locking a particular port. The operating system also comes with tasklist command which lists all the services/applications running in the machine. These commands, netstat & tasklist, can be used in conjunction with each other in a batch file to identify the application locking a specified port. For a complete documentation of the commands use the switch '/?' with the the commands.

No comments: