IT家园's Archiver

hljhhwd 发表于 2008-11-18 20:43

利用批处理设置IP

*前提是正在使用的用户是管理员,并把网卡的名字更改为“本地连接”(默认是“本地连接”,就怕是更改了电源模式,或者自己重命名了网卡!)

比如要把IP设为以下参数
  IP:192.168.0.211
子网:255.255.255.0
网关:192.168.0.220
DNS:192.168.0.1
            222.88.88.88


【批处理设置静态IP】(把以下内容复制到文本文件然后另存为“IP.bat”)
netsh interface ip set address name="本地连接" source = static addr = 192.168.0.211 mask=255.255.255.0
netsh interface ip set address name="本地连接" gateway = 192.168.0.220 gwmetric =0
netsh interface ip set dns name="本地连接" source = static addr = 192.168.0.1 register=PRIMARY
netsh interface ip add dns name="本地连接" addr = 222.88.88.88 index=2


【批处理自动获取IP】】(把以下内容复制到文本文件然后另存为“DHCP.bat”)
netsh interface IP set address name="本地连接" source=dhcp
netsh interface ip set dns name="本地连接" source=dhcp

qhmzxylzq 发表于 2008-11-18 23:11

:P 感谢分享!

qhmzxylzq 发表于 2009-1-22 23:58

感谢分享:P

tang89 发表于 2009-1-30 17:37

还不如手动改得快

页: [1]

Powered by Discuz! Archiver 7.2  © 2001-2009 Comsenz Inc.