Win10 checks whether the port is occupied and which program is occupied (graphic)

In the window system, sometimes the required port number is occupied, but we don't know which program is occupying it. Then we need to find the program using this port.

Methods as below:

1) Open a Command Prompt window (Start-Run) as an administrator.

2) Use the command to view the port usage, here we take port 6001 as an example.

Command: netstat -aon | findstr "6001"

insert image description here

As can be seen from the figure, there is a program occupying port 6001 , and the last column is PID (process ID). That is to say, the process with PID 12780 occupies port 6000.

3) Use the found PID value to find out what program the process with PID 12780 is.

Enter the command: tasklist | findstr "12780"

It can be seen that the node.exe program is occupied.
insert image description here

This picture is a step that was re-executed later, the pid is changed, and the method is fixed.

4) If you do not want this program to continue to occupy the port number, then close this program and enter the command: taskkill /pid 12780 /F

In this way, the program is terminated and the port number is left empty.

Note : In the test, using single quotes is invalid, use double quotes

Guess you like

Origin blog.csdn.net/cuclife/article/details/131324269