computing
  • 0

Can’t Assign Esc Key In a Batch File

  • 0

Hi. I just recently started looking in DOS commands when I had to many shortcuts on my desktop. So I found some simple Batch Menus and copy and edited them so I could use them to cut down the amount of shortcuts on my deskop. Here’s 1 of them.

@echo off
Color 79
goto menu
:menu
ECHO.
ECHO ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO º [ DIRECTORIES ] º
ECHO ÌÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ͹
ECHO º 1. NBA 2k10 º
ECHO º 2. Dragon Age: Origins º
ECHO º 3. Steam º
ECHO º 4. Divinity II – Ego Draconis º
ECHO º 5. Prototype º
ECHO º 6. Close $tax Menu º
ECHO ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO.
ECHO Which Directory Would You Like To Open?
ECHO.
CHOICE /C:123456
IF ERRORLEVEL ==6 EXIT
IF ERRORLEVEL ==5 GOTO PROTOTYPEdir
IF ERRORLEVEL ==4 GOTO DIVINITYdir
IF ERRORLEVEL ==3 GOTO STEAMdir
IF ERRORLEVEL ==2 GOTO DAOdir
IF ERRORLEVEL ==1 GOTO NBA2K10dir
:NBA2K10dir
%SystemRoot%\explorer.exe “C:\Program Files (x86)\2K Sports\NBA 2K10”
cls
goto menu
:DAOdir
%SystemRoot%\explorer.exe “C:\Program Files (x86)\Dragon Age\bin_ship”
cls
goto menu
:STEAMdir
%SystemRoot%\explorer.exe “C:\Program Files (x86)\Steam”
cls
goto menu
:DIVINITYdir
%SystemRoot%\explorer.exe “C:\Program Files (x86)\Divinity2”
cls
goto menu
:PROTOTYPEdir
%SystemRoot%\explorer.exe “C:\Program Files (x86)\Activision\Prototype”
cls
goto menu
:end

This menu works great but I want the Esc key to Exit the menu instead of the #6 how do I assign the Esc key

Share

1 Answer

  1. You probably don’t.

    But you may want to change:

    CHOICE /C;123456

    to either:

    CHOICE /C123456
    CHOICE /C:123456

    so your results are not skewed.

    =====================================
    Helping others achieve escape felicity

    M2

    • 0