Skip to content

Instantly share code, notes, and snippets.

@agtcooke
Created May 22, 2018 15:02
Show Gist options
  • Save agtcooke/217b8014826381cf59854b3930fdf7fc to your computer and use it in GitHub Desktop.
Save agtcooke/217b8014826381cf59854b3930fdf7fc to your computer and use it in GitHub Desktop.
kill_port.bat
@echo off
for /f "tokens=5" %%a in ('netstat -aon ^| findstr %1 ^| findstr LISTENING') do taskkill /pid %%a /f && echo killed PID %%a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment