DOS Variables question

Why doesnt this work? How can I store a value from errorlevel:


ECHO Settings Menu
ECHO ================
ECHO.
ECHO blah blah blah...?
ECHO.
ECHO
ECHO [1] Option 1
ECHO [2] Option 2
ECHO.
ECHO.
ECHO Enter your choice:

CHOICE /C:12 >NUL

IF ERRORLEVEL = 2 SET SRC = "2"
IF ERRORLEVEL = 1 SET SRC = "1"

ECHO You have entered %SRC% > A:OUTPUT.TXT

Comments

  • OK it works in MS-DOS if I remove the spaces:

    SET SRC=%ERRORLEVEL%

    ECHO %SRC%


    But...now it doesnt seem to work in PC-DOS damned. Anyone familar with variablea in IBM PC-DOS?
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories

In this Discussion