Skip to content

Instantly share code, notes, and snippets.

@rasgo-cc
Created January 9, 2020 17:32
Show Gist options
  • Save rasgo-cc/fe01977d8f9d6c4a232522bfa7b4603d to your computer and use it in GitHub Desktop.
Save rasgo-cc/fe01977d8f9d6c4a232522bfa7b4603d to your computer and use it in GitHub Desktop.
Windows killport (kill a process running on a specific port)
REM usage: killport.bat <port>
@echo off
setlocal
echo Killing port %1
for /f "tokens=5" %%a in ('netstat -ano ^| findstr ":%1"') do taskkill /f /pid %%a
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment