How do I do it (run by index) from the command-line without the dialog box?
This is not possible with using a 3-party programs.
You could try using clink:
Clink combines the native Windows shell cmd.exe with the powerful
command line editing features of the GNU Readline library, which
provides rich completion, history, and line-editing capabilities.
Readline is best known for its use in the well-known Unix shell Bash,
the standard shell for Mac OS X and many Linux distributions. Features
- The same line editing as Bash (from GNU’s Readline library).
- History persistence between sessions.
- Context sensitive completion;
- Executables (and aliases).
- Directory commands.
- Environment variables
- Thirdparty tools; Git, Mercurial, SVN, Go, and P4.
- New keyboard shortcuts;
- Paste from clipboard (Ctrl-V).
- Incremental history search (Ctrl-R/Ctrl-S).
- Powerful completion (TAB).
- Undo (Ctrl-Z).
- Automatic “cd ..” (Ctrl-Alt-U).
- Environment variable expansion (Ctrl-Alt-E).
- (press Alt-H for many more…)
- Scriptable completion with Lua.
- Coloured and scriptable prompt.
- Auto-answering of the “Terminate batch job?” prompt.
Is there a way to display the command history with indexes?
doskey /history
displays a list of the previously executed commands however it does not list the indexes.
Press F7 to list the history with indices:

You might also want to look at using:
F5 Scroll through history of typed commands (↑).
F8 Move backwards through the command history, but only display
commands matching the current text at the command prompt.
Source syntax-keyboard
Further Reading