This is pretty simple. It will open up in your default browser.
echo off
setlocal enabledelayedexpansion
REM enabledelayedexpansion is the only way to write variables within the FOR command...more on this later.
set URL1=www.Yahoo.com
set URL2=www.Hotmail.com
set URL3=www.Ebay.com
REM ADD AS MANY URLS AS YOU LIKE UP TO 25
REM JUST MAKE THEIR RESPECTIVE VARIABLE NUMBERS SEQUENTIAL:
REM I.E. URL1, URL2, URL3, ETC.
REM THIS LINE RESTRICT THE NUMBER OF URLS TO AT MOST 25
REM YOU CAN EDIT THIS LINE, BUT DO NOT EDIT BELOW THIS LINE
for /l %%a in (1,1,25) do (
REM this FOR command counts from 1, in increments of 1, to 25.
if not "!URL%%a!"=="" set URLcount=%%a
REM this is asking if the URL# isn't empty, then set the URLCount to that number.
REM this in turn will discover just how many URLS you have listed
for /f "tokens=2 delims=/." %%b in ("!URL%%a!") do set display%%a=%%b
REM this FOR command takes the 2 word that is separated between a "/" or a "." in the URL, and assigns it to the DISPLAY# variable. So if you put in www.yahoo.com as the url, the display word will just be yahoo.
)
set selection=1
:MainMenu
cls
title !display%selection%! Selected.
echo NAVIGATION: I UP, K DOWN, L SELECT, J QUIT
echo.
for /l %%a in (1,1,!URLcount!) do (
REM once again, this just counts from 1 to the number of URLS that you have.
if "!selection!"=="%%a" echo ^>!display%%a!^<
REM this displays the selected URL between brackets.
if not "!selection!"=="%%a" echo !display%%a!
)
choice /c iklj >nul
REM SELECT UP
if "!errorlevel!"=="1" (
set /a selection -=1
if "!selection!"=="0" set selection=!URLcount!
)
REM SELECT DOWN
if "!errorlevel!"=="2" (
set /a selection +=1
if !selection! gtr !URLcount! set selection=1
)
REM SELECT ITEM
if "!errorlevel!"=="3" start !URL%selection%!
REM SELECT QUIT
if "!errorlevel!"=="4" goto :EOF
goto :MainMenu