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

时间:2014-08-27 10:37:47   收藏:0   阅读:269

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

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. 找到进程号对应的app

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

3. kill进程

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.
评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!