基础资料
- 主题:
- 积分:3815
- 帖子:0
- 金币:
- 精华:
- 关注:
- 粉丝:
|
复制以下代码到记事本另存为“setip.bat”
@ echo off
set Nic=本地连接
set Addr=192.168.1.10
set Mask=255.255.255.0
set Gway=192.168.1.1
set Dns1=202.103.224.68
set Dns2=202.103.225.68
rem //以上依次为IP地址、子网掩码、网关、首选DNS、备用DNS
@echo %Nic%
@echo IP地址 = %Addr%
@echo 子网掩码 = %Mask%
@echo 网关 = %Gway%
@echo 首选DNS = %Dns1%
@echo 备用DNS = %Dns2%
pause
echo 正在进行IP设置,请稍等....
netsh interface ip set address name=%Nic% source=static addr=%Addr% mask=%Mask%
netsh interface ip set address name=%Nic% gateway=%Gway% gwmetric=auto
netsh interface ip set dns name=%Nic% source=static addr=%Dns1% register=PRIMARY
netsh interface ip add dns name=%Nic% addr=%Dns2% index=2
@echo on
@echo IP 已设置
@echo off
pause
exit
|
|