Created
January 30, 2019 09:31
-
-
Save qlong8807/01ec8531150d71c97d3d1a50bbf4e0e0 to your computer and use it in GitHub Desktop.
端口杀进程
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
@echo off | |
setlocal enabledelayedexpansion | |
set port=30056 | |
for /f "tokens=1-5" %%a in ('netstat -ano ^| find ":%port%"') do ( | |
if "%%e%" == "" ( | |
set pid=%%d | |
) else ( | |
set pid=%%e | |
) | |
echo !pid! | |
taskkill /f /t /pid !pid! | |
) | |
pause//可有可无 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment