How can I remove the current process/application which is already assigned to a port?
For example: localhost:8080
localhost:8080
You can do by run a bat file:
@ECHO OFF FOR /F "tokens=5" %%T IN ('netstat -a -n -o ^| findstr "9797" ') DO ( SET /A ProcessId=%%T) &GOTO SkipLine :SkipLine echo ProcessId to kill = %ProcessId% taskkill /f /pid %ProcessId% PAUSE