Start — Run — CMD Go to the command prompt and enter netstat -ano to see all connected Pids. Then find the program corresponding to this PID in task Manager. If PID is not available in Task Manager, select “View “-” Select column” in Task Manager.

Often, when we start the application, we find that the port needed by the system is occupied by other programs, how to know who occupies the port we need, many people are more headache, the following is a very simple method, I hope to be useful to you

Suppose we need to determine who is occupying our 9050 port

Run the following command in the Windows CLI:

  1. View the usage of all ports
C:\> netstat -ano
Copy the code

Results:

agreement Local address External address state PID
TCP 127.0.0.1:1434 0.0.0.0:0 LISTENING 3236
TCP 127.0.0.1:5679 0.0.0.0:0 LISTENING 4168
TCP 127.0.0.1:7438 0.0.0.0:0 LISTENING 4168
TCP 127.0.0.1:8015 0.0.0.0:0 LISTENING 1456
TCP 192.168.3.230:139 0.0.0.0:0 LISTENING 4
TCP 192.168.3.230:1957 220.181.31.225:443 ESTABLISHED 3068
TCP 192.168.3.230:2020 183.62.96.189:1522 ESTABLISHED 1456
  1. View the usage of a specified port
C:\> netstat -aon|findstr "9050"
Copy the code
agreement Local address External address state PID
TCP 127.0.0.1:9050 0.0.0.0:0 LISTENING 2016

The port is occupied by a process whose process id is 2016. Run the following command:

  1. View the process corresponding to the PID
C:\> tasklist|findstr "2016"
Copy the code
The name of the image PID The session name Session # Memory usage
tor.exe 2016 Console 0 16064 K.

It’s clear that Tor is taking up your port.

  1. End the process
C:\> taskkill /f /t /im tor.exe
Copy the code

Reprinted from: Simple Book – fold up low

Article: www.jianshu.com/p/633d0b4af…