使用适用于xp2003及他们各自的PE系统环境中
其中在下面:
echo 正在设置IP即DNS的配置.....
@echo off
netsh add helper ifmon.dll
netsh interface ip set address "本地连接" static addr=192.168.1.174 mask=255.255.255.0 gateway=192.168.1.1 auto
netsh interface ip set address "本地连接" static addr=192.168.1.174 mask=255.255.255.0 gateway=192.168.1.1 auto
netsh interface ip set dns name="本地连接" static 218.85.157.99
netsh interface ip add dns name="本地连接" 218.85.152.99
代表的是 IP地址及DNS地址 依次是:
(大家可对照进行修改成自己要的,没技术含量呵呵呵..)
IP地址: 192.168.1.174
子网掩码: 255.255.255.0
默认网关: 192.168.1.1
DNS: 218.85.157.99
218.85.152.99
@echo off
PUSHD %~dp0
SET TP=%CD%
title 欢迎使用靠山王DIY IP-DNS-MAC快速设定
color 4f
echo 正在设置IP即DNS的配置.....
@echo off
netsh add helper ifmon.dll
netsh interface ip set address "本地连接" static addr=192.168.1.174 mask=255.255.255.0 gateway=192.168.1.1 auto
netsh interface ip set address "本地连接" static addr=192.168.1.174 mask=255.255.255.0 gateway=192.168.1.1 auto
netsh interface ip set dns name="本地连接" static 218.85.157.99
netsh interface ip add dns name="本地连接" 218.85.152.99
set ip=192.168.0.123
set mask=255.255.0.0
set gateway=192.168.0.254
set dns=218.2.135.1
set mac=001122334455
if "%ip%"=="" goto eof
reg add "HKLM\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0001" /f /v "NetworkAddress" /t REG_SZ /d "%mac%"
regedit /e %temp%\tmp.reg HKEY_LOCAL_MACHINE\SYSTEM\ControlSet001\Control\Class\{4D36E972-E325-11CE-BFC1-08002bE10318}\0001
for /f "tokens=1,3 delims==&" %%i in ('type %temp%\tmp.reg') do if %%i=="MatchingDeviceId" set dev_id=%%j
del %temp%\tmp.reg
echo on
netsh add helper ifmon.dll
netsh interface ip set address "本地连接" static %ip% %mask% %gateway% auto
netsh interface ip set address "本地连接" static %ip% %mask% %gateway% auto
netsh interface ip set dns "本地连接" static %dns%