What port is a given program using? [closed]
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.
C:\>netstat -anoActive Connections Proto Local Address Foreign Address State PID ... TCP [::]:49335 [::]:0 LISTENING 1056 ...C:\>tasklist /fi "pid eq 1056"Image Name PID Session Name Session# Mem Usage========================= ======== ================ =========== ============sqlservr.exe 1056 Services 0 66,192 K