Dos命令查看端口占用及关闭进程
1. 查看端口占用 在windows命令行窗口下执行: netstat -aon|findstr "8080" TCP 127.0.0.1:80 0.0.0.0:0 LISTENING 2448 端口“8080”被PID(进程号)为2448的进程占用。 查看端口“8080”被哪个应用占用,,继续执行下面命令: tasklist|findstr "2448" notepad.exe 2016 Console 0 16,064 K 2. 关闭进程 2.1 按进程号关闭进程 taskkill /pid 2152 多个时格式为: taskkill /pid 2152 /pid 1284 2.2 按进程名关闭进程 如要关闭notepad.exe,格式为: taskkill /im notepad.exe 指定多个时格式为: taskkill /im notepad.exe /im iexplorer.exe 如果是要关闭所有的,则使用通配符*,即: taskkill /im *.exe 2.3 有提示的关闭进程 taskkill /t /im notepad.exe taskkill /t /pid 2152 这个效果是提示后在使用者确定后关闭,有提示框。 2.4 强行终止进程 taskkill /f /im notepad.exe taskkill /f /pid 2152 3. 端口状态