Windows下查询指定端口进程,并杀死

1. 找到指定端口的进程号

c:devworkslibhttpd-2.4.10-win32-VC9Apache24in>netstat -ano|findstr "9000"
  TCP    0.0.0.0:9000           0.0.0.0:0              LISTENING       4916
  TCP    127.0.0.1:63189        127.0.0.1:9000         TIME_WAIT       0
  TCP    127.0.0.1:63214        127.0.0.1:9000         TIME_WAIT       0
  TCP    [::]:9000              [::]:0                 LISTENING       4916

2. 找到进程号对应的app

c:devworkslibhttpd-2.4.10-win32-VC9Apache24in>tasklist | findstr "4916"
javaw.exe                     4916 Console                    1    433,228 K

3. kill进程

c:devworkslibhttpd-2.4.10-win32-VC9Apache24in>taskkill /f /t /im javaw.exe
SUCCESS: The process with PID 4916 (child process of PID 6480) has been terminat
ed.
原文地址:https://www.cnblogs.com/timelyxyz/p/3938739.html