方便生活,来个备份手册:Windows切换IP和网关的脚本
netsh interface ip set address "本地连接" source=static addr=192.168.0.125 mask=255.255.255.0 netsh interface ip add address "本地连接" 192.168.0.125 255.255.255.0 netsh interface ip add address "本地连接" 192.168.0.126 255.255.255.0 netsh interface ip add address "本地连接" 192.168.0.127 255.255.255.0 netsh interface ip add address "本地连接" 192.168.0.128 255.255.255.0 netsh interface ip add address "本地连接" 192.168.0.129 255.255.255.0 netsh interface ip set address name="本地连接" gateway=192.168.0.253 gwmetric=1 netsh interface ip add address name="本地连接" gateway=192.168.0.254 gwmetric=2 netsh interface ip set dns name="本地连接" source=static addr=192.168.0.253 netsh interface ip add dns "本地连接" 192.168.0.254 pause
netsh interface ip set address "本地连接" source=static addr=192.168.1.100 mask=255.255.255.0 netsh interface ip set address name="本地连接" gateway=192.168.1.1 gwmetric=1 pause
本文提供了一个用于快速切换Windows电脑IP地址和网关的批处理脚本。通过使用netsh命令,该脚本可以帮助用户轻松地在不同的网络环境中配置本地连接的静态IP地址、子网掩码、默认网关及DNS服务器。
1527

被折叠的 条评论
为什么被折叠?



