- @echo on
- ipconfig /all >1.txt
- setlocal enabledelayedexpansion
- for /f "tokens=2,3 skip=9 delims=器:" %%p in (1.txt) do (
- set /a str+=1
- if !str!==1 call :a "%%p"
- )
- :a
-
- netsh interface ip set address name="%1" source=static addr=192.168.1.187 mask=255.255.255.0 gateway=192.168.1.1
- pause
复制代码 我这是要给网卡设置IP 先检测本地连接名称然后给网卡设置IP,可是每次都提示找不到元素,这是为什么,求解? |