Is the MS-DOS 'Choice' command gone?

G

Guest

WinXP help indicates that the 'choice' command is no longer available. That
was the command I used to get a one character input from a user during the
running of a .bat file.

What does one use for that functionality now that 'choice' has been removed?
 
G

Galen

In Raisleger <[email protected]> had this to say:

My reply is at the bottom of your sent message:
WinXP help indicates that the 'choice' command is no longer
available. That was the command I used to get a one character input
from a user during the running of a .bat file.

What does one use for that functionality now that 'choice' has been
removed?

Start here:

http://www.computerhope.com/batch.htm

Read... Enjoy... (It's a nice site actually.)

The information YOU want specifically is on this page which is linked from
the above page:

http://www.computerhope.com/sethlp.htm

Galen
 
G

george

Raisleger said:
WinXP help indicates that the 'choice' command is no longer available.
That
was the command I used to get a one character input from a user during the
running of a .bat file.

What does one use for that functionality now that 'choice' has been
removed?

check out this page and its referral
https://partners.psc.com/PSCTekForum/topic.asp?TOPIC_ID=2151
or alternatively get choice.com from a win98 or possibly win-me disk (if you
still happen to have one around).
Works just as well with 2k or xp.

hth

george
 
W

Wesley Vogel

Use the set command. Read on, McDuff.

Windows XP users who have batch files that utilize the choice command
should modify the batch file to use the set command.

Information about the set command.
http://www.computerhope.com/sethlp.htm

I can't get the sample batch file with "hello", "bye", or "test" to work
yet. But I'm still trying. :)

I wonder if choice can be copied from a machine Windows 98 machine? I
just searched my machine I have choice.exe and choice.com. They came
with ie-spyad.

ie-spyad ReadMe says CHOICE.COM apparently has compatibility issues with
the Windows XP command shell interpreter. CHOICE.EXE is compatible with
Windows XP.

CHOICE.EXE comes with Windows Server 2003, Standard Edition.

Choice.exe is part of the Windows 2000 Professional Resource Kit.

Windows 2000 Professional Resource Kit Tools
http://www.microsoft.com/windows2000/techinfo/reskit/rktour/pro/Pro_tools.asp#C

Some other ideas here...
Batch files - Ask For User Input
http://www.robvanderwoude.com/userinput.html

[[you can always steal a copy of CHOICE.EXE from a Win9x box. All
reports I've heard say it works just fine.]]
http://www.ericphelps.com/batch/userin/

If you weren't using that stupid CDO I'd attach a copy of choice.exe,
it's only 21KB.

Yep. It works...

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

C:\>choice /?
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.
----------------------------
--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
Raisleger said:
The WinXP help indicates that the 'choice' command has been
eliminiated as an MS-DOS command. I used that in some 'bat' files to
get a 1-char input from the user.

What can be used in its place? How do you get user input now in a
'bat' file?



--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 
S

Stan Brown

WinXP help indicates that the 'choice' command is no longer available. That
was the command I used to get a one character input from a user during the
running of a .bat file.

What does one use for that functionality now that 'choice' has been removed?

Oh crap. If I'd known you posted the same query twice in a quarter of an hour, I
wouldn't have replied.
 
W

Wesley Vogel

I just figured out why my post was listed before yours and you posted
first. Your date is set incorrectly.


--
Hope this helps. Let us know.

Wes
MS-MVP Windows Shell/User

In
 

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