下载​​git bash​​​就可以用​​shell​​脚本了

这里是关闭端口​​8888​​的占用进程,改端口只需要在第一行改

比较方便hhh

netstat -o -n -a | findstr :8888 > in.txt
flag=0
port=0
for line in `cat in.txt`
do
if [ "$line" == "LISTENING" ]
then
flag=1
continue
elif [ "$flag" == "1" ]
then
echo "正在删除PID=${line}"
`taskkill //F //PID ${line}`
fi
flag=0
done