标签:blog http ar 使用 for on 2014 log ad
@echo off
set PortNum=3306
for /f "tokens=15" %%a in ('ipconfig^|findstr /i /c:"IP Address"') do (
set IP=%%a
)
for /f "tokens=5" %%a in ('netstat -ano^|findstr "%IP%:%PortNum%"') do (
set PID=%%a
)
echo 端口号%PortNum%对应的PID是:%PID%
pause或者可使用如下批处理:
2. 已知进程名找端口号
3.启动服务终止服务
标签:blog http ar 使用 for on 2014 log ad
原文地址:http://blog.csdn.net/shineych/article/details/41440543