I want to be able to figure out what port a particular program is using. Are there any programs available online or that come with windows that will tell me which processes are using which ports on my computer?
PS - before you downmod this for not being a programming question, I'm looking for the program to test some networking code.
most decent firewall programs should allow you to access this information. I know that Agnitum OutpostPro Firewall does.
You can use the 'netstat' command for this. There's a description of doing this sort of thing here.
If your prefer a GUI interface CurrPorts is free and works with all versions of windows. Shows ports and what process has them open.
TCPView can do what you asked for.
netstat -b -a
lists the ports in use and gives you the executable that's using each one. I believe you need to be in the administrator group to do this, and I don't know what security implications there are on Vista.I usually add
-n
as well to make it a little faster, but adding-b
can make it quite slow.Edit: If you need more functionality than netstat provides, vasac suggests that you try TCPView.
On Vista, you do need elevated privileges to use the -b option with netstat. To get around that, you could run "netstat -ano" which will show all open ports along with the associated process id. You could then use tasklist to lookup which process has the corresponding id.