View Single Post
  #22  
Old May 30th 18, 06:14 PM posted to alt.comp.os.windows-10,microsoft.public.windowsxp.general,alt.windows7.general
Frank Slootweg
external usenet poster
 
Posts: 1,226
Default How do you make a batch file accept 1-char keyboard input WITHOUT having to also press carriage return?

Char Jackson wrote:
On Wed, 30 May 2018 12:15:43 +0100, Java Jive
wrote:

On 30/05/2018 08:11, Ralph Fox wrote:

Be aware that CHOICE is not supported in Windows XP.


Nonsense, as in ...

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\TEMPchoice /?
CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]

/C[:]choices Specifies allowable keys. Default is YN
/N Do not display choices and ? at end of prompt string.
/S Treat choice keys as case sensitive.
/T[:]c,nn Default choice to c after nn seconds
text Prompt string to display

ERRORLEVEL is set to offset of key user presses in choices.


My XP VM reports the following:

Microsoft Windows XP [Version 5.1.2600]
(C) Copyright 1985-2001 Microsoft Corp.

C:\TEMPchoice /?
'choice' is not recognized as an internal or external command,
operable program or batch file.


Hmmm!? This page is somewhat ambiguous, but says "Windows XP and
earlier syntax" (Generally the ComputerHope 'DOS' pages are quite
accurate.):

https://www.computerhope.com/choicehl.htm

[Too much trouble to fetch my dormant XP machine, but if really needed,
I can get it, fire it up and try.]
Ads