天天看点

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

命令行批量测试ip
    
@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 primaryping  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      

谢谢支持!

2016.6.26