How to see if the port is occupied and then processing?
Step 1. Windows view all ports
Click Start in the lower left corner of the computer, then select the Run option, and then we enter the [cmd] command in the pop-up window to enter the command prompt. Then we enter [netstat -ano] in the window and press Enter to display all port occupancy. as the picture shows:
![How to see if the port is occupied?](http://files.jb51.net/file_images/article/201403/2014031917224960.jpg)
Step 2. Query the specified port occupancy
In the window, continue to enter [netstat -aon|findstr "prompted port"], for example, the port suggested by Xiaobian is 2080, then Xiaobian will enter the command as [netstat -aon|findstr "2080"], and then press Enter. You can see the PID in the list, and then check the corresponding occupied program in the task manager of the computer according to the PID, and then close it.
Step 3. Query the process corresponding to the PID
If after the above steps, the PID we get is 2016, then we can enter the command [tasklist|findstr "2016"], and the name displayed on the first line is the program name, so that we can understand the port occupied by that program.
Step 4. Then we enter the command [taskkill /f /t /im program name].
![turn off an app](http://files.jb51.net/file_images/article/201403/2014031917224961.jpg)
The above is all about how to view the port in Windows, I hope it will be helpful to you.
plain text version
How to check the port occupancy in Windows is as follows:
Start -- run --cmd to enter the command prompt, enter netstat -ano to see the PID of all connections, and then find the program corresponding to this PID in the task manager. If there is no PID in the task manager, you can In Task Manager, select "View" - "Select Columns"
Often, when we start the application, we find that the port required by the system is occupied by other programs. How to know who has the port we need is a headache for many people. Here is a very simple method, I hope it will be useful to everyone.
Suppose we need to determine who is occupying our port 9050
1. Windows platform
Execute in the windows command line window:
1. View all port occupancy
C:\>netstat -ano
Protocol Local Address External Address Status 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
TCP 192.168.3.230:2927 117.79.91.18:80 ESTABLISHED 4732
TCP 192.168.3.230:2929 117.79.91.18:80 ESTABLISHED 4732
TCP 192.168.3.230:2930 117.79.91.18:80 ESTABLISHED 4732
TCP 192.168.3.230:2931 117.79.91.18:80 ESTABLISHED 4732
2. Check the occupancy of the specified port
C:\>netstat -aon|findstr "9050"
Protocol Local Address External Address Status PID
TCP 127.0.0.1:9050 0.0.0.0:0 LISTENING 2016
P: Did you see that the port is occupied by the process whose process number is 2016, continue to execute the following command: (You can also go to the task manager to view the process corresponding to the pid)
3. View the process corresponding to the PID
C:\>tasklist|findstr "2016"
image name PID session name session# memory usage
========================= ======== ================
tor.exe 2016 Console 0 16,064 K
P: It's very clear, tor occupies your port.
4. End the process
C:\>taskkill /f /t /im tor.exe
Some friends feel that it is troublesome to enter commands. You can use some auxiliary software (CurrPorts, Yapu port scanner, Fanhua port viewing tool, local port queryer) to check the port occupancy.