How do I kill the process currently using a port on localhost in Windows?

后端 未结 20 2303
陌清茗
陌清茗 2020-11-22 11:37

How can I remove the current process/application which is already assigned to a port?

For example: localhost:8080

20条回答
  •  旧时难觅i
    2020-11-22 12:20

    Result for windows

    In my case 8080 is the port I wants to kill
    And 18264 is the PID listening to the port 8080
    So the task you have to kill is the pid for the particular port

    C:\Users\Niroshan>netstat -ano|findstr "PID :8080"
    
    Proto Local Address Foreign Address State PID
    TCP 0.0.0.0:8080 0.0.0.0:0 LISTENING 18264
    
    taskkill /pid 18264 /f
    
    

提交回复
热议问题