• 5
name Punditsdkoslkdosdkoskdo

How can i find out which ports are used by a program?

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.

  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)
  • 4
Reply Report

If you are using windows you can use the free utility "Process Explorer" for this - among many other things. You have to run it in Administrator mode though.

enter image description here

  • 1
Reply Report

If you are wanting to optimize something like a game or netflix streaming, then you don't need to worry about the port on your computer - that is the client, and is (somewhat) randomly chosen from the higher range of ports. What you want is to find out what port(s) the service you are connecting to is provided on, and optimize connections to those ports from your machine (possibly by MAC address? or local lan ip)

Most game server browsers will show port information, or you can always connect to whatever service and then open a terminal window (start -> cmd.exe) and use netstat to find out what programs are connecting to what ports on what IP addresses. Here's a link to the docs for the windows version of it -

  • 2
Reply Report