Windows XP: Figure Out What Service is Running on a Specific Port
Posted by alex in Insights at 8:11 PMFinding out what application is running on a specific port in Windows XP is easy by using two command line utilities. By using netstat with the proper switches you can list out all of the ports that are being used and then use Tasklist to list all of the applications that are running. The combination of the two utilities will allow you to figure out which application us using which port. As an example you can use the below directions to figure out what application is using port 80 for instance.
- Open Command Prompt: Click Start in the lower left hand corner of your PC and then select Run from the pop up. Type command in the Run window and click Enter to open up the command prompt.
- List Ports: Now use the below netstat command to list all of the applications using port 80 for instance. I have cygwin installed which also allows me to use grep. If you do not have this installed simply remove the | grep after the netstat command.
netstat -ano | grep 80
Example Output:
C:\>netstat -aon | grep 80
TCP 0.0.0.0:80 0.0.0.0:0 LISTENING 3000
TCP 192.168.1.98:1145 209.89.235.19:80 CLOSE_WAIT 2976
TCP 192.168.1.98:1180 73.5.34.175:1863 ESTABLISHED 3260As you can see the local computer is listening to port 80 on every available IP. The last number indicates the PID of the application running on port 80. So you will need to remember that for the next command. - List Running Applications: Now use Tasklist as shown below to list the running applications and their coresponding PID (Process ID). We will be locating whatever application is running using PID 3000.
Tasklist | grep 3000
Example Output:
C:\>Tasklist | grep 3000
Skype.exe 3000 Console 0 9,960 KAs you can see the application using PID 3000 and running on port 80 is Skype.

Entries (RSS)
For the examples using grep, since this is windows specific, you can use “findstr” instead of having to install cygwin. “findstr” has been included with Windows XP and forward I believe.
[Reply]
alex Reply:
April 27th, 2009 at 12:19 AM
Awesome! Thanks for the information. This is very useful to most people. ~!~ What about actually posting some articles my man! :) Hope all is well.
[Reply]
That does not work for me. I get “netstat” is not recognized as an internal or external command. If I type “netstat -ano” in the run field from the start menu, I get the proper window for a microsecond.
[Reply]
alex Reply:
September 9th, 2009 at 7:48 PM
Hello Chris,
This means that netstat is not on your path or you are possibly trying to run the command from a user that does not have the permissions to do so. Try starting your command window using Start >> Run and typing “command” without the quotes. If that does not work try typing “cmd” into the Run box to launch the command Window. Make sure you are logged in as an administrator.
If none of the above works then please let us know the version of Windows and copy/paste the command along with the error that is displayed.
Thanks.
Alex
[Reply]
Hey,
I used cygwin and the command fine
[Reply]
alex Reply:
March 9th, 2010 at 9:37 PM
Hello ChannelSwimmer,
Thanks for taking the ime to leave feedback.
Thanks.
alex
[Reply]