dmxiaoma 当前离线
列兵
set "AdapterNamea=以太网适配器 本地连接" set "AdapterNameb=Ethernet adapter 本地连接" set "FileTmp=%temp%\ipList.txt" ipconfig /all >"%FileTmp%" for /f "delims=:" %%i in ('findstr /n /c:"%AdapterNamea%" /c:"%AdapterNameb%" "%FileTmp%"') do ( set "SkipRow=%%i" goto :DoSkip )复制代码
ygqiang 当前在线
少尉
TOP
B魔方大人 当前离线
上等兵
求大神们帮写段代码: 运行wmic nicconfig get IPAddress,MACAddress |findstr "192.168.1.109" 得到结果 ... dmxiaoma 发表于 2017-2-16 17:33
GNU 当前离线
上尉
taofan712 当前离线
六级士官
@echo off for /f "tokens=2 delims=:" %%a in ('ipconfig /all^|find "Physical Address"') do ( set mac=%%a ) for /f "tokens=2 delims=:" %%b in ('ipconfig /all^|find "IP Address"') do ( set ip=%%b ) echo; %mac% %ip% &pause>nul复制代码