Use the accelerator key win+r to open the Run window. Enter CMD return to open a command prompt window
1: View the port that is open for this machine, that is, the number of ports that have been occupied.
Command:
Netstat-an
Partial results list:
Proto Local Address Foreign
TCP 0.0.0.0:135 0.0.0.0:0 Listening
TCP 0.0.0.0:3473 0.0.0.0:0 Listening
TCP 0.0.0.0:8009 0.0.0.0:0 Listening
The local addresss corresponds to this column, ":" is the open port number behind.
2: See if a port number is occupied
For example, to see if MySQL's default service port 3306 is already occupied
Command:
Netstat-ano|findstr "3306"
----If no results are returned, the port is not occupied.
----If the result returned is:
TCP 0.0.0.0:8080 0.0.0.0:0 Listening 1640
Indicates that port 8080 is already occupied. 1640 is the process number that occupies 8080 of this port number.
3: View process number corresponding to the process name
Task Manager:
If you do not have a PID (process ID) column, you can select the column in the Task Manager's menu Bar-View-selection column.
Command:
Tasklist|findstr "1640"
This is the name of the process to view the 1640 process number.
The result returned is:
Tomcat5.exe 1640Console 0 33,802 K
Tomcat5.exe is the name of the process that occupies the 1640 port number.
4: End Process
You can end it directly in Task Manager, and open Task Manager shortcut key: Ctrl+shift+esc
Command:
Tskill process Name/process number
such as: Tskill Tomcat5.exe
Tskill 1640
If the process cannot end, you can close its application directly. or by using other tools
such as: xuetr (this tool can be downloaded in a personal network).