端口占用停止进程
2018-06-22 本文已影响0人
圼_2514
1.根据端口获取pid
命令:netstat -ano | findstr 端口号
执行:netstat -ano | findstr 5555

2.第一步中最后一列为pid 8456
3.根据pid查看进程
命令:tasklist | findstr pid
执行:tasklist | findstr 8456

4.强制结束进程
命令帮助信息 taskkill /?
/pid processid 指定要终止的进程的pid,使用tasklist 获取pid
/IM imagename 指定要终止的进程的映像名称,通配符''*''可以用来指定所有任务或映像名称
/t 指定终止的进程和由它启动的子进程
/f 强制终止进程
例如:
TASKKILL /IM notepad.exe
TASKKILL /PID 1230 /PID 1241 /PID 1253 /T
TASKKILL /F /IM cmd.exe /T
命令 taskkill /f /pid pid
执行:taskkill /f /pid 8456
