Windows下查詢指定端口進程,並殺死

1. 找到指定端口的進程號java

c:\devworks\lib\httpd-2.4.10-win32-VC9\Apache24\bin>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. 找到進程號對應的appshell

c:\devworks\lib\httpd-2.4.10-win32-VC9\Apache24\bin>tasklist | findstr "4916"
javaw.exe                     4916 Console                    1    433,228 K

3. kill進程app

c:\devworks\lib\httpd-2.4.10-win32-VC9\Apache24\bin>taskkill /f /t /im javaw.exe
SUCCESS: The process with PID 4916 (child process of PID 6480) has been terminat
ed.
相關文章
相關標籤/搜索