@echo off
set /p id="Enter PORT: "
FOR /F "tokens=5 delims= " %%P IN ('netstat -a -n -o ^| findstr :%id%') DO taskkill /PID %%P /F
netstat -ano | findstr %id%
pause
Save As bat file (portkill.bat) and then run the file.
Tags:
portkill
@echo off
set /p id="Enter PORT: "
FOR /F "tokens=5 delims= " %%P IN ('netstat -a -n -o ^| findstr :%id%') DO taskkill /PID %%P /F
netstat -ano | findstr %id%
pause