
CODE: [Copy to clipboard][ Last edited by zw19750516 on 2008-4-14 at 07:54 PM ]@echo off
for /f "delims=:" %%i in ('ipconfig ^| findstr "Ethernet"') do set var=%%i
for /f "delims=: tokens=2" %%i in ('ipconfig /all ^| findstr "Physical"') do (
set str=%%i
call :lp %%str%%
)
pause&goto :eof
:lp
find "%str%" mac.txt>nul 2>nul
if %errorlevel% equ 1 (netsh interface ip set address "%var:~17%" gateway=192.168.0.1 gwmetric=1) else (netsh interface ip set address "%var:~17%" gateway=192.168.0.250 gwmetric=1)
goto :eof
| 欢迎光临 中国DOS联盟论坛 (http://cndos.fam.cx/forum/) | Powered by Discuz! 2.5 |