What are you trying to accomplish here? You don't have this in any sort of Batch script language. Are you wanting a menu? What do you want the options to do?
From what I can gather, try this:
@echo off
:Menu
cls
echo 1 Perform a self Ping Test
echo 2 Enter a IP to Ping
echo 3 Exit
echo.
set /p ans=
if "%ans%"=="1" (
ping 127.0.0.1
pause
goto Menu
)
if "%ans%"=="2" (
set /p ip=IP:
ping %ip%
pause
goto Menu
if "%ans%"=="3" (exit)
goto Menu
This program will require that you press 3 to exit. It also will only do something with a 1 2 or 3, and will display the Menu again if it receives anything else. When asking for something, please be much more specific as to what you want, as that is more helpful in the long run.