操作方法
首先查看需要设置的本地连接名称,如果网卡只有一个一般为【本地连接】
先是本地连接的【开启】与【关闭】设置 新建两个TXT文本,输入以下命令,打开本地连接用enabled,关闭用disabled两个二选一,输入后将txt后缀修改为BAT netsh interface set interface 本地连接 enabled netsh interface set interface 本地连接 disabled
下面设置动态IP,自动获取IP netsh interface ip set address 本地连接 dhcp
静态IP设置方法 实例:设置IP为192.168.0.62 子网掩码:255.255.255.0 网关:192.168.0.100 DNS:192.168.0.1 备用DNS:192.168.0.2 netsh interface ip set address 本地连接 static 192.168.0.62 255.255.255.0 192.168.0.100 netsh interface ip set dns 本地连接 static 192.168.0.1 netsh interface ip add dns 本地连接 192.168.0.2 index=2 可以多设置几个类似的静态IP批处理文件就可以根据情况自由切换了