Find program Port

Source: Internet
Author: User
Tags network function

After installing Microsoft's SP2 Patch, you will find that the firewall is very different from the ICF before the patch is installed. This is a comprehensive upgrade of the Windows XP firewall, many new features are incomparable to those of the original Firewall.
By default, the system firewall will block all programs that access the network. During the Monitoring Program, the non-security default port is also disabled. If you need to open those ports, you need to add them separately. Otherwise, the program using this port will not work normally. In some cases, you must manually add rules to make some ports open successfully and create an environment for normal application.
If a network tool used does not know which port to use, how can it be used to conveniently know the port number used when it is working? If you have any questions about this, this article will help you solve the problem.
1. first, run the program and try to enable its network function (if it is a Web service, start the corresponding service). Then, Enter CMD in "run" in the Start menu and press Enter, open the MS-DOS command line method and enter:
Netstat-ano> netstat.txt
Tip: If you want to use the netstat parameter in more detail, you can enter netstat /? .
2.after the execution is complete, the netstatcommand will input all the detected listening ports to the netstat.txt file. In this case, do not close the command line window and continue to execute the following command line:
Tasklist> tasklist.txt
Tip: The tasklist command is used to display the application and service list of all tasks running on a local or remote computer, with a process ID (PID ). After the command is executed, the Progress token will be saved to the tasklist.txt file.
3. No prompt message is displayed when you execute the preceding command. In the token file, find the entry corresponding to the token recorded just now, and the port is in this line. Record the Protocol (TCP or UDP) used at the same time, so that all the "Network in and out" statuses about the program will be completely mastered.
By using this method, you can find the port and protocol used by an application accessing the network at any time. In this way, you only need to add the relevant content of the port on the firewall settings page.
This method also has some drawbacks. When an application uses multiple ports, it is not easy. However, in general, we don't have to worry about such a program. In addition, if the number of ports used by the program is greater than 1024, the port will not change. If Port 1024 or less is used, the program may use a port in a certain range. So sometimes it is not surprising that a program is still unable to work when some ports are opened.

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.