命令行批量修改IP并ping测试

@echo off

set ip=0

:begin
set /a ip=%ip%+1
netsh interface ip set address "本地连接" static 172.20.209.%ip% 255.255.0.0 172.20.209.1
netsh interface ip set dns "本地连接" static 221.228.255.1 primary

ping  172.20.209.1  && goto :write || echo "不通"

:write
echo "===========================">> ip.txt
ping  172.20.209.1>> ip.txt
echo 172.20.209.%ip% >> ip.txt
echo "===========================">> ip.txt
goto :begin

谢谢支持!

可以联系我进行交流。Renhanlinbsl@163.com

2016.6.26

23:21

posted @ 2016-06-26 23:16  Hey,Coder!  阅读(352)  评论(0编辑  收藏  举报