[Date Prev][Date Next][Subject Prev][Subject Next][ Date Index][ Subject Index]

Re: Autoexec.nt commands



Re Robert's CHOICE.BAT using SET /P
It works. I got a strange result when I hit ENTER instead of responding with y/N:
Yes was unexpected at this time.

That must come from CMD.EXE, since it does not appear in CHOICE.BAT.
I recall that Robert said the ENTER was used to terminate the response from the user, so I would assume that just hitting ENTER would produce a null.

Also, what does this interesting line mean:
if %oui%!==! set oui=N
I would assume that it is designed to handle any user-response other than "y" and the logic of the test that follows distinguishes "y" from everything else:

if %oui%==y set oui=Y
if %oui%==Y echo OK
if not %oui%==Y echo Not OK
Interestingly, the user-response is not case-sensitive. I.e., Y and y produce the same "OK."


Harry Binswanger
hb@xxxxxxxx