Batch file help plz ><

Hey

I was ask to create a batch file that will prompt the user using the CHOICE and GOTO commands.


@echo off
cls
REM create menu
echo *****************
echo * f = Notepad *
echo * n = Explorer *
echo * e = Control Panel*
echo *****************


REM offer choice to user
choice /e nec /f "Enter the program you wish to open:"


REM if user enters C, run Control Panel
if not errorlevel 3 goto exp
control.exe
goto end

:exp
REM if user enters E, run Explorer

if not errorlevel 2 goto note
explorer.exe
goto end

:note
REM if user enters N, run notepad
if errorlevel 1 notepad.exe
goto end

:end

[/code:1:5b30a46df0]

When i run the batch file i get:
"choice" is not recognized as an internal or external command,operable program or batch file.

Could some one take a look and suggest a way to fix it please.

thank for your time
3 answers Last reply
More about batch file
  1. Do you have Choice in your path?
  2. Quote:
    Do you have Choice in your path?


    No real restrictions just want it to work lol
  3. Quote:
    Do you have Choice in your path?

    No real restrictions just want it to work lol
    If you did, it probably would.
Ask a new question

Read More

Explorer Windows XP