Leya 发表于 2008-5-3 00:44:02

利用批处理自动填写ip

以下为自动填写ip


@echo off

echo This is the begin..
echo Set IP Address..

netsh interface ip set address name="本地连接" source=static addr=192.168.0.2 mask=255.255.255.0

rem 设置本地连接的ip地址为:192.168.0.22,子网掩码为:255.255.255.0
echo setMask and Gateway..

netsh interface ip set address name="本地连接" gateway=192.168.0.1 gwmetric=0

rem 设置网关

netsh interface ip set dns name="本地连接" source=static addr=202.102.154.33 register=PRIMARY

echo set First DNS
rem 设置主dns

netsh interface ip add dns name="本地连接" addr=202.102.134.68
echo set Second DNS
rem 设置备份dns

netsh interface ip set wins name="本地连接" source=static addr=none

rem 设置wins

echo This is the ending..



以下为自动设置成自动获取

@echo off

echo This is the begin..

netsh interface ip set address name="本地连接" source=dhcp

netsh interface ip set dns name="本地连接" source=dhcp register=PRIMARY

netsh interface ip set wins name="本地连接" source=dhcp

echo This is the ending..

页: [1]
查看完整版本: 利用批处理自动填写ip