Windows – How to find out which ports are used by a program

internetnetworkingportswindows

I try to figure out which ports a specific program uses if they send data to the internet. Is there a tool which is able to find this out? Or do I have to do package inspection by using wireshark?

Background: I try to create a priority rule on my fritz!box 7490 router, so that some computer games are seen as real-time applications and there are as less lags as possible e.g. if someone in the network decides to watch videos on youtube while I am playing online.

Best Answer

  1. Determine PID of your program

    tasklist | find "myprogram.exe"
    
  2. Check ports in third column of output from

    netstat /a /n /o | find " 4564"
    
    • there is a space before PID to rule out inappropriate matches potentially coming from other columns (a little trick)
    • /n keeps addresses in numeric form (without resolving) what causes the command to finish without delays (it should suffice for what you need)
Related Question