choice always returns 0

W

Wayne

It seems my "errorlevel" is broken...

Any help?


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

always returns 0 ???
 
M

Mark V

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.
 
G

Guest

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...
 
A

Al Dunbar [MS-MVP]

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top