複製貼上到記事本,另存為xx.bat,編碼選ANSI
@echo off
rem 根據txt檔案裡列出的多個ip執行ping檢測通斷情況
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
cd /d "%~dp0"
set "input=ip列表.txt"
set "output=結果.txt"
type nul>"%output%"
echo;開始ping,稍後……
for /f "tokens=1*" %%i in ("type "%input%"") do (
echo;正在ping %%i
ping -w 15 -n 2 %%i|>nul find /i "TTL="&&(
>>"%output%" echo;%%i %%j 網路通暢
)||(
>>"%output%" echo;%%i %%j 網路故障
)
echo;完成
echo;%#% +%$%%$%/%@% %z%
pause
複製貼上到記事本,另存為xx.bat,編碼選ANSI
@echo off
rem 根據txt檔案裡列出的多個ip執行ping檢測通斷情況
set #=Any question&set @=WX&set $=Q&set/az=0x53b7e0b4
title %#% +%$%%$%/%@% %z%
cd /d "%~dp0"
set "input=ip列表.txt"
set "output=結果.txt"
type nul>"%output%"
echo;開始ping,稍後……
for /f "tokens=1*" %%i in ("type "%input%"") do (
echo;正在ping %%i
ping -w 15 -n 2 %%i|>nul find /i "TTL="&&(
>>"%output%" echo;%%i %%j 網路通暢
)||(
>>"%output%" echo;%%i %%j 網路故障
)
)
echo;完成
echo;%#% +%$%%$%/%@% %z%
pause