1. Enter netstat-ano in cmd.
2. For example, if I check what occupies port 80, the corresponding process PID is 3600.
3. Enter tasklist to check which process PID 3600 is.ProgramRunning, we can quickly see That tomcat 6 is using PID 3600, which occupies port 80.
In this case, you can use taskkill/PID 3600/T/F to quickly close the process.
Or
Start -- run -- cmd enter the command prompt and enter netstat-ano. Then you can see all connected PIDs and find the program corresponding to the PID in the task manager. If no PID exists in the task manager, you can select "View"-"Select column" in the task manager"
If we need to determine who occupies our port 9050
1. Windows Platform
Run netstat-Aon | findstr "9050" in the Windows command line window"
TCP 127.0.0.1: 9050 0.0.0.0: 0 listening 2016
The port is occupied by a process with process number 2016. Run the following command: C:/> tasklist | findstr "2016"
Tor.exe 2016 console 0 16,064 K. The TOR occupies your port.