[新手上路]批处理新手入门导读[视频教程]批处理基础视频教程[视频教程]VBS基础视频教程[批处理精品]批处理版照片整理器
[批处理精品]纯批处理备份&还原驱动[批处理精品]CMD命令50条不能说的秘密[在线下载]第三方命令行工具[在线帮助]VBScript / JScript 在线参考
返回列表 发帖
这个得指定本地连接1的ip ,本地连接2的ip, 如果不指定,系统无法知道你要修改的是哪个本地连接的地址?

TOP

本帖最后由 wjx515 于 2014-8-5 10:05 编辑

call %systemdrive%\install\ChangIP.vbs /ip:192.168.99.1 /掩码:255.255.255.0 /网关:192.168.99.254 /DNS:114.114.114.114,202.96.128.86

这个只有一个ip,如果有多个网卡怎么设置?

For Each objNetAdapter in colNetAdapters
        If Isarray(arrIPAddress) And Isarray(arrSubnetMask)  Then objNetAdapter.EnableStatic arrIPAddress,arrSubnetMask
        If Isarray(arrGateway) Then objNetAdapter.SetGateways arrGateway
        If Isarray(arrDNS) Then objNetAdapter.SetDNSServerSearchOrder arrDNS
    Next

多个网卡设置为同一个ip? linux支持多网卡共享单个ip,windows好像不支持吧


如果想为每个网卡设置一个ip可以先使用wmic获取活动的网卡的名称,然后再使用netsh interface ip set address 设置ip
获取网卡名称:wmic nic where "NetConnectionStatus=2" get NetConnectionID
设置ip:netsh interface ip set address "%x%" static 192.168.1.100 255.255.255.0 192.168.1.1
x是上面wmic获取的网卡名称

TOP

返回列表