Board logo

标题: [网络连接] 网段存活查看错误 [打印本页]

作者: ads350668398    时间: 2021-9-26 14:15     标题: 网段存活查看错误

@echo off
for /L %%i IN (1,1,254) DO (ping -w 2 -n 1 172.28.0.%%i -n 1 && echo  172.28.0.%%i>>iok.txt || echo  172.28.0.%%i >>ino.txt)



ping -n 1 -W "300000"127.0.0.1 >nul
pause
arp -a >>ip存活.txt
********************
@echo off
for /L %%i IN (1,1,254) DO (
     for /L %%m IN (%%i) DO (
ping -w 2 -n 1 172.28.%%i.%%m -n 1 && echo  172.28.%%i.%%m >>iok.txt || echo  172.28.%%i.%%m >>ino.txt
)
  )



ping -n 1 -W "300000"127.0.0.1 >nul
pause
arp -a >>ip存活.txt
***************
上段正常,下雨段嵌套失败为什么啊??
作者: ads350668398    时间: 2021-9-26 15:05

好吧 把%%1变成1.1.254可以了




欢迎光临 批处理之家 (http://www.bathome.net/) Powered by Discuz! 7.2