diff --git a/GetExternalIP.bat b/GetExternalIP.bat index d99d543..6d6f807 100644 --- a/GetExternalIP.bat +++ b/GetExternalIP.bat @@ -1,26 +1,30 @@ @echo off -powershell -Command "(Invoke-WebRequest -Uri 'https://api.ipify.org').Content" -echo. +:MENU +cls echo Seleccione una opcion: echo 1. Obtener direccion IP externa echo 2. Listar archivos del directorio echo 3. Hacer ping a Google (5 veces) echo. -set /p opcion="Ingrese el numero de opcion: " +set /p opcion=Ingrese el numero de opcion: +if "%opcion%"=="1" goto IP +if "%opcion%"=="2" goto LISTAR +if "%opcion%"=="3" goto PING +echo Opcion invalida. +pause +goto MENU -if "%opcion%"=="1" ( - echo Obteniendo IP externa... - powershell -Command "(Invoke-WebRequest -Uri 'https://api.ipify.org').Content" -) else if "%opcion%"=="2" ( - echo. - echo Listando archivos del directorio: - dir -) else if "%opcion%"=="3" ( - echo. - echo Haciendo ping a Google (5 veces)... - ping -n 5 google.com -) else ( - echo Opcion invalida -) +:IP +powershell -Command "(Invoke-WebRequest -Uri 'https://api.ipify.org').Content" +pause +goto MENU -pause \ No newline at end of file +:LISTAR +dir +pause +goto MENU + +:PING +ping www.google.com -n 5 +pause +goto MENU \ No newline at end of file