[No0000CB]如何在命令行(cmd)通过TCP/IP端口(port)查询所在的进程号(pid)或进程名称,并终止该进程

 

1)首先查找占用某个端口的进程PID

netstat -ano | findstr [port]

2)根据该进程pid查询进程名称或标题,确认那个程序在占用该端口

tasklist /v | findstr [pid]

3)确认无误后,根据pid终止该进程

taskkill -pid [pid]

 
 
原文地址:https://www.cnblogs.com/Chary/p/No0000CB.html