PC Review


Reply
Thread Tools Rate Thread

Choice command in Batch Files

 
 
Thusitha
Guest
Posts: n/a
 
      6th Oct 2003
earlier with win98 I could use 'choice' command in batch
files. But with win2000 it is not available. How can I
use 'CHOICE' command in win2000 batch files ? pl. give me
an example.
 
Reply With Quote
 
 
 
 
Phil Robyn
Guest
Posts: n/a
 
      6th Oct 2003
Thusitha wrote:

> earlier with win98 I could use 'choice' command in batch
> files. But with win2000 it is not available. How can I
> use 'CHOICE' command in win2000 batch files ? pl. give me
> an example.


Have a look at other messages in this newsgroup with 'choice'
in the subject field.

--
Phil Robyn
Univ. of California, Berkeley

u n z i p m y a d d r e s s t o s e n d e - m a i l

 
Reply With Quote
 
Ray at
Guest
Posts: n/a
 
      6th Oct 2003
http://groups.google.com/groups?thre...phx.gbl&rnum=1

Ray at home

"Thusitha" <(E-Mail Removed)> wrote in message
news:027801c38bce$6d41d2a0$(E-Mail Removed)...
> earlier with win98 I could use 'choice' command in batch
> files. But with win2000 it is not available. How can I
> use 'CHOICE' command in win2000 batch files ? pl. give me
> an example.



 
Reply With Quote
 
Alan Tang
Guest
Posts: n/a
 
      6th Oct 2003


Thusitha wrote:

> earlier with win98 I could use 'choice' command in batch
> files. But with win2000 it is not available. How can I
> use 'CHOICE' command in win2000 batch files ? pl. give me
> an example.


Try to use :

SET /P TEST_VAR="Please enter the number! "
if "%TEST_VAR%"=="1" echo Your Ans=1
if "%TEST_VAR%"=="2" echo Your Ans=2
if "%TEST_VAR%"=="3" echo Your Ans=3
if /i "%TEST_VAR%"=="a" echo Your Ans=A
if /i "%TEST_VAR%"=="b" echo Your Ans=B
if /i "%TEST_VAR%"=="c" echo Your Ans=C



--
Best Regards,
Alan Tang


 
Reply With Quote
 
Mark V
Guest
Posts: n/a
 
      6th Oct 2003
Thusitha wrote in news:027801c38bce$6d41d2a0$(E-Mail Removed):

> earlier with win98 I could use 'choice' command in batch
> files. But with win2000 it is not available. How can I
> use 'CHOICE' command in win2000 batch files ? pl. give me
> an example.


See other answers and note that it is _possible_ to use and older
CHOICE.EXE (eg NT4 Resource Kit) in W2K/XP but that running 2 or more
instances may fail. SET /P varname=
is the best built-in solution.
 
Reply With Quote
 
Bill Stewart
Guest
Posts: n/a
 
      6th Oct 2003
Thusitha <(E-Mail Removed)> wrote:

> earlier with win98 I could use 'choice' command in batch files. But with
> win2000 it is not available. How can I use 'CHOICE' command in win2000
> batch files ? pl. give me an example.


http://home.comcast.net/~stewartb/cmdprompt.html#5


 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Batch Files - Windows XP and the CHOICE command =?Utf-8?B?UmljaGFyZCBUcm9pYW5v?= libam com> Windows XP General 4 11th Oct 2006 11:50 PM
UTF-8, command prompt, notepad, batch files =?Utf-8?B?QW50dGk=?= Windows XP General 0 16th Dec 2005 03:13 PM
DOS .... Command Prompt ..... Batch Files Microsoft Windows 2000 CMD Promt 2 26th Jun 2005 06:23 PM
Console replication of old CHOICE DOS command - how to timeout? - choice.vb (0/1) Mark A. Nadig Microsoft VB .NET 13 17th Mar 2005 04:40 PM
Command Prompt & Batch Files Herb Stevenson Microsoft Dot NET 2 15th Jun 2004 03:36 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 12:15 AM.