choice always returns 0

  • Thread starter Thread starter Wayne
  • Start date Start date
W

Wayne

It seems my "errorlevel" is broken...

Any help?


@choice /c:ynx "Answer: "
@echo %errorlevel%

always returns 0 ???
 
In said:
It seems my "errorlevel" is broken...

Any help?


@choice /c:ynx "Answer: "
@echo %errorlevel%

always returns 0 ???

Are you running under command.com? Use cmd.exe.

Choice.exe may fail in NTx systems. Look at (if available)
SET /P
(set /?)
for one way to prompt.
 
I'm using this to start my session:

start "DOS 1" cmd /E:ON /F:ON /V:ON /T:1E

D> set/p is available, but this worked until the other day
when I finished an FTP session...
 
Wayne said:
It seems my "errorlevel" is broken...

Any help?


@choice /c:ynx "Answer: "
@echo %errorlevel%

always returns 0 ???

If I had to decide which to blame for such a problem between the built-in
errorlevel functionality and a utility designed for an earlier version of
the operating system I would place my bet on the error having been caused by
CHOICE, not ERRORLEVEL.

/Al
 
Back
Top