cmd to solve the port is occupied


1. Win+r opens the cmd window

Please add a picture description

2. Find the pid number of the occupied port, such as port 8080

Input command: If there is the following output, it means that the current port is being occupied, remember the last number, which is the pid process number of the current portnetstat -aon|findstr "8080"

Please add a picture description

3. Kill the current pid process by command

Input command: After entering the command, it will prompt that the process with PID 16712 has been terminated. When passing the second step of query, if there is no output, it means that the current port has been releasedtaskkill /pid 16712 /f

Please add a picture description


Summarize

It is very annoying that the port number is occupied. This article kills the process in one step through the cmd window.

Guess you like

Origin blog.csdn.net/SmallCat0912/article/details/125562013