How about this?
dir.menu
# Comments and empty lines are ignored
# Lines starting with a hyphen '-' indicate a group
- Editors
1 Notepad.exe
2 WordPad.exe
# You can use numbers or letters, and even words (without spaces)
- Graphics
P mspaint.exe
menu.bat
@setlocal
@echo off
if not exist ".\dir.menu" echo There is no "dir.menu" file in the current directory. & goto :end
set arg=%~1
if not defined arg goto :show_menu
for /f "tokens=1,* delims= " %%i in (dir.menu) do (
if not "%%i"=="#" if /i "%arg%"=="%%i" (
start "x" "%%j"
)
)
:end
endlocal
exit /B
:show_menu
echo Menu:
echo ===================
for /f "tokens=1,* delims= " %%i in (dir.menu) do (
if not "%%i"=="#" (
if "%%i"=="-" (
echo %%j
) else (
echo %%i] %%j
)
)
)
goto :end
This is a simple, but nice menu system. You can use numbers or letters (or a word, without spaces) as the key. I've kept it very simple so you can see how to interact with it. (For instance, you could create a set of directories as a whole menu system, where the menu items are all inside 'dir.menu' files.)
Sample usage:
>menu
Menu:
===================
Editors
1] Notepad.exe
2] WordPad.exe
Graphics
P] mspaint.exe
>menu p
[mspaint is launched]
>
UPDATED: tested and corrected a couple things from my computer, instead of my phone.