所以我正在处理ping批处理文件..
它为您提供了一个选项,该选项是循环ping或不循环ping。
要么选择,要使ping不循环,现在,我已经想通了,即使ping命令首先出现,也将是两种方式的选择.. 例如,如果循环命令是第一个,它将循环任一选择,相反的方式循环。
这是我的批处理脚本..
@echo off
title Viper Ping by Sp00kie
echo " __ __ _ ____ _ "
echo " \ \ / / (_) _ __ ___ _ __ | _ \ (_) _ __ __ _ "
echo " \ \ / / | | | '_ \ / _ \ | '__| | |_) | | | | '_ \ / _` |"
echo " \ V / | | | |_) | | __/ | | | __/ | | | | | | | (_| |"
echo " \_/ |_| | .__/ \___| |_| |_| |_| |_| |_| \__, |"
echo " |_| |___/ "
color a
choice /m "Loop ping?"
IF /I '%Input%'=='Y' GOTO LoopPing
IF /I '%Input%'=='N' GOTO NormalPing
echo "
echo "
echo "
echo "
:NormalPing
set /p UserInputPath1= "IP/Domain >> "
ping %UserInputPath1% -n 1 -w 2000 || goto pingFail
echo "
echo Ping was Successful to %UserInputPath1% at %date% %time%
Echo "
Echo "
Choice /m "Ping Another IP/Domain?"
if %ERRORLEVEL%==2 GOTO :EOF
cls
goto start
:pingFail
:LoopPing
set /p UserInputPath2= "IP/Domain >> "
ping %UserInputPath2% -t || goto pingFail
echo "
echo Ping was Successful to %UserInputPath1% at %date% %time%
Echo "
Echo "
Choice /m "Ping Another IP/Domain?"
if %ERRORLEVEL%==2 GOTO :EOF
pause