so I am working on a ping batch file..
It gives you an option, and that option is to loop ping or to not loop ping.
Either choice, makes the ping not loop, now, I have figured out, which even ping command comes first, will be the choice either way.. for example, if the loop command is first, it will loop on either choice, same way for the other way around.
Here is my batch script..
@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