window批处理杀死指定端口进程,注意保存时使用ansi格式,运行输入端口即可 @echo off setlocal enabledelayedexpansion set /p port=请输入端口号: for /f "tokens=1-5" %%a in ('netstat -ano ^| find ":%port%"') do ( if "%%e%" == "" ( set pid=%%d ) else ( set pi…
@echo off setlocal enabledelayedexpansion set /p port=请输入端口号: 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 /pid !pid!…
1 SET CurrDir=%CD% CD.. SET InstPath=%CD% CD %CurrDir% 2 pushd.. set parent=%cd% popd 参考: https://msfn.org/board/topic/65204-how-to-get-parent-path-in-bat/…