How to Determine Which Ports Are Active in Windows
To restrict the use of open ports, you need to know which ports are active on your system and which programs are using them. So how do you check open ports to see what application is already using it?
Task Manager, is an important tool because it tells you what processes are running. To open Task Manager, press Ctrl + Shift + Esc keys. Click the Processes tab and be sure the Show Processes From All Users check box is selected. To sort by one of the columns, click the column heading; it's often convenient to sort by process identifier (PID) if you're looking up these numbers frequently.
The Netstat command-line program can provide much of the detail you need about active ports. To use it, open the Command Prompt by clicking Start Menu --> All Programs --> Accessories, right-click on Command Prompt, and open it as an administrator. In Windows Vista and later versions of Window operating systems type cmd.exe into Start Screen or Start Menu, right-click on Cmd.exe, and open it as an administrator.
If you type in the simplest form of the command, netstat with no command-line arguments, the command shows which ports are being actively used. To find out which program is using each connection, add the -ab argument to the command line. This argument displays the process name that has opened the connection.
Scroll through the list to find the port (which is listed after the colon to the right of the local IP address), and you’ll see the process name listed under that line.
Here, for example, you can see that port 1585 is tied up by a process named firefox.exe.
You can also execute netstat -ano command to displays all connections, listening ports and owning process ID (PID) associated with each connection.
The column at the far right lists PIDs, so just find the one that’s bound to the port that you’re trying to troubleshoot.
Next, open up Task Manager by right-clicking any open space on your taskbar and choosing “Task Manager.”
You’ll see this information on the “Processes” and "Details" tabs. Sort the list of process by the “PID” column and find the PID associated with the port you’re investigating. You might be able to tell more about what app or service has the port tied up by looking at the “Description” or "Process name" column.
Tip
When used with the /Fi switch, Tasklist displays information only about the particular task in which you're interested. For example, to see which service is running as PID 944, you could type tasklist /svc /fi "pid eq 944" at the Command Prompt. This command filters the output to include only lines in which the PID is equal to 944.
To make your life easier that's if you are not a Command Prompt type, we recommend the excellent freeware CurrPorts utility by NirSoft.
It’s a portable app, so you won’t need to install it. Just unzip the download folder and run executable.
In the CurrPorts window, sort by the “Local Port” column, find the port you’re investigating, and you can see everything—the process name, PID, port, the full path to the process, and so on.
To make it even easier, double-click on any process to see every single detail in one window.
When you've figured out what application or service has the port you're exploring tied up, it's dependent upon you how to deal with it.
Did you find this tutorial helpful? Don’t forget to share your views with us.