sept 发表于 2008-8-22 15:33

TCP/IP中设置IP地址如何用rundll32.exe来实现?

传统设置IP地址操作方式:
本地连接-------右键属性------Internet属性(TCP/IP)-------设置IP
步骤太多了,有没有偷懒的方法? 如何用开始--运行rundll32的方式打开?
PS:不想借助别的小软件来操作,^u^

zb0502 发表于 2008-8-22 16:12

如果是自动获得地址的,用 ipconfig 命令

固定地址的用 netsh 命令

用法详见帮助

City_of_God 发表于 2008-8-24 12:36

复制下面的代码,保存为bat后缀的文件:

@echo off
@echo 开始设置IP

netsh interface ip set address name=”本地连接” source=static addr=192.168.1.2 mask=255.255.255.0 gateway=192.168.1.1 gwmetric=auto

netsh interface ip set dns name=”本地连接” source=static addr=203.80.96.10 register=primary

netsh interface ip add dns name=”本地连接” addr=202.106.0.133 index=2

@echo on
@echo IP已设置
@echo off
pause
exit

liu_yunsheng 发表于 2008-8-25 10:44

netsh这个除非写脚步,否则对一般人来说更麻烦。不过的确功能强大。

hushao 发表于 2008-8-25 11:01

netsh interface ip set address "BrandBand" static 192.168.1.154 255.255.255.0 192.168.1.1 1
netsh interface ip set dns "BrandBand" static 218.2.135.1

这个可以实现
页: [1]
查看完整版本: TCP/IP中设置IP地址如何用rundll32.exe来实现?