Search code examples
socketscmd

Windows command line program that lists open sockets of certain process


I know that on windows I can type "netstat -an" and find open tcp connections.

But there is no information about the processes that own that tcp connections.

In Linux you get this info with "lsof".

Is there a free command line program that gives this information?


Solution

  • On Windows 2000 and later, netstat can display the process ID for each open socket via the -o parameter, eg:

    netstat -ano
    

    See MSDN for more details:

    The netstat command can now display process IDs that correspond to active TCP or UDP connections in Windows 2000

    SysInternals TCPView can display process names, and has both GUI and command-line interfaces.