jkfran / killport

A command-line tool to easily kill processes running on a specified port.
MIT License
1.68k stars 37 forks source link

Support windows #12

Closed axetroy closed 1 year ago

axetroy commented 1 year ago

We can find the process via netstat.exe -ano and kill with via taskkill.exe /F /T /PID {processID} in windows

Here is the example code

Find process: https://github.com/axetroy/kpv/blob/master/process/find_by_port_windows.c.v

Kill process: https://github.com/axetroy/kpv/blob/master/process/kill_windows.c.v

BasixKOR commented 1 year ago

The WinAPI equivalents are: GetTcpTable2's dwOwningPid, TerminateProcess.

Can I try implementing this?