 |
 |

How do I find the Ports used by a program when connected to the Internet?
When creating exceptions in Windows Firewall, you will need the port number and the protocol. To find the port number and the protocol of a program, use the following steps.
Note: A list of ports numbers for well-known services can be found by opening the C:\Windows\System32\drivers\etc\services file in Notepad.
- Start the program and attempt to use its network features. In this example, we used Windows Media Player and opened the Radio.
- Export the list of currently running tasks to a text file.
- From the Start menu, click Run.
- In the Run dialog box, type: CMD. Click OK.
- At the command prompt, type: tasklist /svc > c:\tasklist.txt. Press the ENTER key on your keyboard.
Note: If using Windows XP Home Edition, tasklist may not be a recognized command. If this is the case, the Process Identifier (PID) must be found using Windows Task Manager. Open Windows Task Manager, click the Processes tab, click View, and then click Select Columns. In the Select Columns dialog box, check PID (Process Identifier), and then click OK. Locate the program you are troubleshooting and find the corresponding PID number.
- Export the list of currently open ports to a text file.
- At the command prompt, type: netstat -aon >c:\netstat.txt. Press ENTER.
View Picture
- Open tasklist.txt.
- From the Start menu, click Run.
- In the Run dialog box, type: c:\tasklist.txt. Click OK.
- In the tasklist file, locate the program you are troubleshooting. Note the Process Identifier (PID) for the process. In this example we are troubleshooting Windows Media Player (wmplayer), which is PID 1988.
View Picture
- Open netstat.txt.
- From the Start menu, click Run.
- In the Run dialog box, type: c:\netstat.txt. Click OK.
- In the netstat file, find an entry with the same PID as you found in the earlier step. In this example, we are finding PID 1988.
View Picture
- In the netstat file, note the protocol used (TCP or UDP) for the PID you found. In this example, the protocol is UDP.
- In the netstat file, note the port number for the PID you found. The port number is the number following the IP address in the Local Address column. In this example, the IP address is 127.0.0.1 and the port number is 1081. Windows Firewall requires the port number and the protocol to create an exception. In this example, the port number is 1081 and the protocol is UDP.
Note: If the port number(s) for the process are less than 1024, it is likely that the port numbers will not change. If the numbers used are greater than 1024, the application may be using a range of ports, so opening individual ports may not reliably resolve the issue.
|
 |
 |