|
|
发表于 2008-4-10 17:05:48
|
显示全部楼层
@echo off
color 1f
title MADE by 公孙轩辕
setlocal EnableDelayedExpansion
for /f "tokens=*" %%i in (1txt) do (
set wang=%%i
echo 正在ping %%i
ping /n 5 !wang! >tmp.txt
if "!errorlevel!"=="1" call :fail
if "!errorlevel!"=="0" echo ping %%i 成功 & call :suc)
echo\&echo\
echo 全部ping完成!按任意键继续……
del tmp.txt
pause
exit
:suc
for /f "tokens=4 delims= " %%i in ('find "statistics" tmp.txt') do (
set k=%%i
set wang2=!k:~0,-2!
echo !wang2! >>2.txt)
goto :eof
:fail
echo ping !wang! 失败
goto :eof |
|