批处理命令-更换Win7/10/XP本机IP地址

自动获取:

netsh interface ip set address name="以太网" source=dhcp
netsh interface ip set dns "以太网" source=dhcp

静态Ip:

Win7/Win10:

netsh interface ip set address name="以太网" source=static addr=127.0.0.1 mask=255.255.255.0 gateway=127.0.0.254
netsh interface ip set dns "以太网" source=static addr=8.8.8.8

WinXP:

netsh interface ip set address name="本地连接" source=static addr=127.0.0.1 mask=255.255.255.0
netsh interface ip set address name="本地连接" gateway=127.0.0.254 gwmetric=0
netsh interface ip set dns "本地连接" source=static addr=8.8.8.8

posted @ 2020-11-25 10:44  bky123  阅读(334)  评论(0编辑  收藏  举报