Sometimes when installing the program, the XX port is occupied, you can use the cmd command to see what the program occupies
1. Netstat-ano view the corresponding port corresponding program PIDFor example:
- C:\>netstat-ano
- Active Connections
- Proto Local Address Foreign address State PID
- TCP 0.0.0.0:135 0.0.0.0:0 LISTENING 1760
- TCP 0.0.0.0:445 0.0.0.0:0 LISTENING 4
- TCP 0.0.0.0:2967 0.0.0.0:0 LISTENING 660
- TCP 0.0.0.0:3389 0.0.0.0:0 LISTENING 1712
- TCP 0.0.0.0:3934 0.0.0.0:0 LISTENING 728
- TCP 0.0.0.0:10700 0.0.0.0:0 LISTENING 4920
- TCP 10.186.20.116:21 0.0.0.0:0 LISTENING 272
- TCP 10.186.20.116:80 0.0.0.0:0 LISTENING 4516
You can see that the 21-port-occupied process PID is 272.
2. Tasklist view the corresponding PID number of the program
- TASKLIST/FI "PID eq pid"
Cases
- C:\>TASKLIST/FI "PID eq 272"
- Image name PID session name Session # Memory usage
- ========================= ====== ================ ======== ============
- ServUDaemon.exe 272 Console 0 3,980 K
3. If you want to release the port with the Tskill PID commandexample, if you want to release port 21
- Taskill 272
--the end--
Transferred from: http://blog.chinaunix.net/u2/88533/showart_1815741.html
How to view ports under Windows by program