保存为bat脚本,设置需要解除占用的端口 port,点击运行即可
@echo off setlocal enabledelayedexpansion set prot = 8022 for /f "delims= tokens=1" %%i in (‘netstat -aon ^| findstr "%prot %"‘) do ( set a=%%i goto js ) :js taskkill /f /pid "!a:~71,5!" pause>nul
2022-09-16 12:49:35
保存为bat脚本,设置需要解除占用的端口 port,点击运行即可
@echo off setlocal enabledelayedexpansion set prot = 8022 for /f "delims= tokens=1" %%i in (‘netstat -aon ^| findstr "%prot %"‘) do ( set a=%%i goto js ) :js taskkill /f /pid "!a:~71,5!" pause>nul