Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

I know that, in Windows, you could do the following to see what processes are attached to a port:

netstat -a -b

However, how would you limit the display to ports attached to a specific process? I looked at findstr but that doesn't help because the process' executable is not mentioned on the same line as the port information:

PS C:\Users\nimmylebby> netstat -a -b
 [svchost.exe]
  TCP    [::]:49154             NIMMY-LAPTOP:0         LISTENING
  Schedule
 [svchost.exe]
  TCP    [::]:49155             NIMMY-LAPTOP:0         LISTENING
 [services.exe]
  TCP    [::]:49156             NIMMY-LAPTOP:0         LISTENING
 [lsass.exe]
  UDP    0.0.0.0:500            *:*
  IKEEXT
 [svchost.exe]
  UDP    0.0.0.0:3702           *:*
  FDResPub
 [svchost.exe]

Anyone have any clue?

share|improve this question

1 Answer 1

up vote 2 down vote accepted

One option is to use Sysinternals TCPView, which includes a command line version that lets you filter on a process name:

Using Tcpvcon

Tcpvcon usage is similar to that of the built-in Windows netstat utility:

Usage: tcpvcon [-a] [-c] [-n] [process name or PID]

-a Show all endpoints (default is to show established TCP connections). -c Print output as CSV. -n Don't resolve addresses..

share|improve this answer
    
The page for TCPView apparently moved; it appears to be available under technet.microsoft.com/en-us/sysinternals/bb897437 now. –  sleske Feb 8 '11 at 9:46
    
@sleske: Thanks. Updated. –  zdan Feb 13 '11 at 1:31

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.