windowsportinternet-connection

How to display the port numbers of open connections for a specific process with tcpvcon.exe (Windows 10)?


I have both TCPView and Tcpvcon on my Windows 10 machine and I wonder how to get all the information (port numbers, etc.) displayed in TCPView in the output of the Tcpvcon program? TCPView has the process name, PID, protocol, remote address, remote port, etc. in its output to the GUI. Tcpvcon, on the other hand, only contains the process name, protocol, remote and local address. I would like to have all information that can be read in the TCPView GUI in the command line output of Tcpvcon (especially the port numbers). Tcpvcon seems to have only the three switches -a -c -n but no matter how I combine them, I do not reach my goal. Can anyone help me?

Below is a sample output when I use all three switches. In TCPView I see much more information about the specified process. enter image description here


Solution

  • I was also very surprised that tcpvcon does not show port numbers (maybe we should ask Mark R. to add them ;-)

    BUT you could use

    netstat -a -o -n
    

    or with an admin shell even

    netstat -a -o -n -b
    

    switches meaning:

    -a ... Displays all active TCP connections and the TCP and UDP ports 
           on which the computer is listening.
    
    -o ... Displays active TCP connections and includes the process ID (PID)
           for each connection.
    
    -n ... Displays active TCP connections, however, addresses and port numbers 
           are expressed numerically and no attempt is made to determine names.
    
    -b ... Displays the executable involved in creating each connection or 
           listening port. (Note that this option can be time-consuming and 
           will fail unless you have sufficient permissions.)
    

    To get all available switches just use netstat -? (there are other interesting ones) or https://learn.microsoft.com/en-us/windows-server/administration/windows-commands/netstat

    swobi