大佬们求帮助,我想批量ping地址,然后在百度搜了一点代码,但是ping这个ip段只会在表格里显示一个失败或成功。
我想的是,能够在表格里显示整个ip段所有ip的状态,每个ip都显示通或者不通。
求大佬帮助。
我找到的代码是这样的。
@echo off
setlocal enabledelayedexpansion
date /t > last.xls
time /t >> last.xls
For /L %%f in (1,1,10) Do Ping.exe -n 1 41.189.16.%%f
if !errorlevel! EQU 0 @echo % 成功>>last.xls
if !errorlevel! EQU 1 @echo % 失败>>last.xls
)
)


我想的是,能够在表格里显示整个ip段所有ip的状态,每个ip都显示通或者不通。
求大佬帮助。
我找到的代码是这样的。
@echo off
setlocal enabledelayedexpansion
date /t > last.xls
time /t >> last.xls
For /L %%f in (1,1,10) Do Ping.exe -n 1 41.189.16.%%f
if !errorlevel! EQU 0 @echo % 成功>>last.xls
if !errorlevel! EQU 1 @echo % 失败>>last.xls
)
)

