How to find what program has a port open on Windows XP

If you ever need to figure out what program might have a specific port open for some reason here is an easy 2 steps that will get you what you need.

From a command prompt type:

netstat -noa | findstr :1042

this should give you some output that looks similar to this:

TCP 0.0.0.0:1042 0.0.0.0:0 LISTENING 1952

From that line you take the last number (1952) which represents the process id. Then type:

tasklist /fi "PID eq 1952"

Here is the result as you would see this whole process.

netstat example

I’ve found myself having to look up how to do that twice. Now that I’ve written it here I’ll remember it.