Discussion on:

20
Comments

Join the conversation!

Follow via:
RSS
Email Alert
0 Votes
+ -
Contributr
Thanks, Rick

Great tip.
0 Votes
+ -
Contributr
yeah...
b4real@... 21st Oct 2008
Definitely mucho handy.
0 Votes
+ -
use portqry
ascott@... 22nd Oct 2008
use "portqry -local" it works on any windows OS. Search for portqry on google, it's my favourite utility.
If you add -b (so netstat -a -b -n -o) it also lists the executable used.
If you just want to know the executable using the port you might find it easier just to use "netstat -b". Use "netstat /h" for more information on what netstat can do.
0 Votes
+ -
Another way
bigQ123 22nd Oct 2008
You can also use TcpView from the Sysinternals guys at Microsoft Technet to see the same information. Its a windows based application instead of command line.

It keeps a live view on the connections, showing new ones in green highlight, closed connections in red highlight, and much more too.

You really should download the Sysinternals Suite, as there's so many useful utilities in there.
0 Votes
+ -
Another GUI tool
techrepublic@... Updated - 22nd Oct 2008
Another amazing GUI tool that can be used is CPorts (http://www.nirsoft.net/utils/cports.html). It works even on Vista/W2008 x86/x64, is very small in size and has a bunch of filters to list the processes. It's free and doesn't even have to be installed: just run the standalone program and it's done.
Very interesting. Please how do one stop a listening port that have been identified by the tasklist command.
0 Votes
+ -
How do you stop a listening port? Just kill the process that has it open. But you can actually close just the port by using a third-party utility called Sysinternals TCPView. Just google it.
Does anyone know how to retrieve this information through Visual Basic or vbscript?
http://www.activexperts.com/activmonitor/windowsmanagement/adminscripts/networking/snmp/#RetrieveTcpUdp.htm

However, you need to install the SNMP Protocol & the WMI SNMP Provider to get this to work... at least under Windows XP. You can add this via Add/Remove Programs, under Management and Monitoring Tools.
netstat -no -vb in Win Server 2003 will give you the
process name right away, without the need the tasklist
tool that does not come with the standard
installation, you need to install Windows
Administrative tools in order to get tasklist.
0 Votes
+ -
or just go get the Tcpview.exe utility from the sysinternals website and it tells it to you in a gui with the application already prenamed.
netstat -b will show all the info in one place... or am I missing something?
0 Votes
+ -
Contributr
PIDs
b4real@... 12th Nov 2008
You don't get the pids, for more obscure processes or duplicate processes of the same names, it becomes more difficult to determine which one to kill.
0 Votes
+ -
re - PIDs
sawaddell@... 21st Apr 2009
actually you do get the PIDS
netstat -a -n -b will list the pid & process
just use netstat -nab and it gives you the same info without having to use two different commands.
hi,

I used this to stop some process that was holding my port.

This is very useful and did work for me, but i had one issue with this.

I have started multiple processes with same name
(i am running multiple servers and java processes)

I had many javaw processes, although i knew name of process, i still cant kill this.

Windows 2003, cmd prompt sp1.

Thanks,
amit
Keyboard Shortcuts:
Prev
Next
Toggle
Join the conversation
Formatting +
BB Codes - Note: HTML is not supported in forums
  • [b] Bold [/b]
  • [i] Italic [/i]
  • [u] Underline [/u]
  • [s] Strikethrough [/s]
  • [q] "Quote" [/q]
  • [ol][*] 1. Ordered List [/ol]
  • [ul][*] · Unordered List [/ul]
  • [pre] Preformat [/pre]
  • [quote] "Blockquote" [/quote]

Join the TechRepublic Community and join the conversation! Signing-up is free and quick, Do it now, we want to hear your opinion.