windows 根据 端口号 找到进程ID PID

List process by port number

netstat -ano | findstr 8080

Proto  Local Address          Foreign Address        State           PID
  TCP    0.0.0.0:8080           0.0.0.0:0              LISTENING       29848
  • -a – Displays all connections and listening ports.
  • -o – Displays the owning process ID associated with each connection.
  • -n – Displays addresses and port numbers in numerical form.
taskkill /F /PID 29848

 

windows把脚本放到后台执行

start /b xxx.bat

 


版权声明:本文为fareast_mzh原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接和本声明。