本帖最后由 lifei259 于 2017-11-4 18:17 编辑
- @echo off
- >1.txt more +20 "%~f0"
- for /f "delims=*" %%i in ('ipconfig/all^|findstr /l /i "物理地址"') do (
- for /f "tokens=2 delims=:" %%j in ("%%i") do (
- for /f "delims= " %%k in ("%%j") do (
- for /f "skip=1 tokens=1,2 delims= " %%a in ('type,1.txt') do (
- if "%%k"=="%%a" (
- echo 开始设置本地专用IP网络地址! ,请稍等……
- netsh interface ip set address name="本地连接" static addr=%%b 255.255.255.0 192.168.254.2 1>nul
- netsh interface ip set dns name="本地连接" static addr=192.168.254.2>nul
- netsh interface ip add dns name="本地连接" 222.222.222.222>nul
- cls
- ipconfig /flushdns
- echo.&echo.
- echo.设置完成请核对,请按任意键退出
- ipconfig /all
- pause>nul)
- ))))
- del /a /f 1.txt&pause
- exit
- 物理地址 ip
- 00-0C-29-D5-AD-13 192.168.245.129
- 74-D4-35-CD-30-5E 192.168.1.2
- 74-D4-35-CD-30-6E 192.168.1.20
- 74-D4-35-CD-30-7E 192.168.1.25
复制代码
|