Google Groups no longer supports new Usenet posts or subscriptions. Historical content remains viewable.
Dismiss

Re: (WinXP Corporate) 'choice' is not recognized as an internal or external command

1,102 views
Skip to first unread message

Matthias Tacke

unread,
Nov 12, 2004, 1:01:10 PM11/12/04
to
EdP schrieb:
> my set environment
> Path=C:\WINDOWS\System32;C:\WINDOWS\System32\wbem
>
Windows %systemroot% is missing. See:
>
http://home.comcast.net/~stewartb/cmdprompt.html#6

HTH

--
Gruesse Greetings Saludos Saluti Salutations
Matthias
---------+---------+---------+---------+---------+---------+---------+

foxidrive

unread,
Nov 12, 2004, 8:47:40 PM11/12/04
to
On 12 Nov 2004 09:29:13 -0800, EdP wrote:

> Anyboy have any idea why choice won't work anymore?

Choice isn't a standard part of XP. You can still use the choice.exe from
Win9x etc.

Timo Salmi

unread,
Nov 12, 2004, 10:05:09 PM11/12/04
to
In article <4dae3698.04111...@posting.google.com>,

EdP <e...@callingsolutions.com> wrote:
> Anyboy have any idea why choice won't work anymore?

As explained in

103196 Sep 8 2004 ftp://garbo.uwasa.fi/pc/link/tscmd.zip
tscmd.zip Useful NT/2000/XP script tricks and tips, T.Salmi

14) Help! My old batch files won't work since there is no choice.

Q: When I try to run my old batch file as a CMD.EXE script I get
"'choice' is not recognized as an internal or external command,
operable program or batch file." What can I do?

A: The CHOICE command has been dropped because it can cause
collisions in the NT/2000/XP multi-tasking environment. Thus the
best choice (if you pardon the pun) is not try to find an old
version, but patiently write your scripts anew using SET /P. Below
is a simple demonstration
@echo off
setlocal
:_again
set /p ask_="Please respond [Y,N,Q]?"
for %%a in (y n q) do if /i "%ask_%"=="%%a" goto _%%a
goto _again
::
:_y
echo Your input was Yes& goto :EOF
:_n
echo Your input was No& goto :EOF
:_q
echo Your input was Quit& goto :EOF
endlocal

However, you might try a clone such as CHOOSE.EXE "Ask questions in
batch/script files" from ftp://garbo.uwasa.fi/pc/ts/tsutlf17.zip or
later. (Now also included in tscmd.zip)
@echo off & setlocal enableextensions
choose /tq,5 /cynq "Give your answer "
if errorlevel==0 if not errorlevel==1 echo You effected a break
if errorlevel==1 if not errorlevel==2 echo Your input was Yes
if errorlevel==2 if not errorlevel==3 echo Your input was No
if errorlevel==3 if not errorlevel==4 echo Your input was Quit
if errorlevel==255 echo Error condition
endlocal & goto :EOF

Alternatively
@echo off & setlocal enableextensions
choose /tq,5 /cynq /x "Give your answer "
for %%c in (call del) do %%c choose_.bat
if "%choose_%"=="0" echo You effected a break
if "%choose_%"=="1" echo Your input was Yes
if "%choose_%"=="2" echo Your input was No
if "%choose_%"=="3" echo Your input was Quit
if "%choose_%"=="255" echo Error condition
endlocal & goto :EOF

The output in both the cases might be e.g.
D:\TEST>cmdfaq
Give your answer [Y,N,Q]?Q
Your input was Quit

The obvious advantage of CHOOSE.EXE over the SET /P method is that
the former can handle timed default input.

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland
Timo's FAQ materials at http://www.uwasa.fi/~ts/http/tsfaq.html

Todd Vargo

unread,
Nov 13, 2004, 3:06:03 PM11/13/04
to

"Timo Salmi" <t...@UWasa.Fi> wrote:
> A: The CHOICE command has been dropped because it can cause
> collisions in the NT/2000/XP multi-tasking environment.
snip...

> However, you might try a clone such as CHOOSE.EXE "Ask questions in
> batch/script files" from ftp://garbo.uwasa.fi/pc/ts/tsutlf17.zip or
> later. (Now also included in tscmd.zip)

snip...

> The obvious advantage of CHOOSE.EXE over the SET /P method is that
> the former can handle timed default input.

What sort of collisions are you referring to? Filename?

--
Todd Vargo (double "L" to reply by email)

Timo Salmi

unread,
Nov 14, 2004, 1:26:36 AM11/14/04
to
In article <cn6ta6$4...@poiju.uwasa.fi>, Timo Salmi <t...@UWasa.Fi> wrote:

> Todd Vargo <todd...@alvantage.com> wrote:
> > "Timo Salmi" <t...@UWasa.Fi> wrote:
> > > A: The CHOICE command has been dropped because it can cause
> > > collisions in the NT/2000/XP multi-tasking environment.

> > What sort of collisions are you referring to? Filename?

> I picked the claim up some time ago, and can't find to source. Maybe

It probably was this:
http://www.google.com/groups?selm=3E1C6329...@uclink.berkeley.edu

All the best, Timo

--
Prof. Timo Salmi ftp & http://garbo.uwasa.fi/ archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <http://www.uwasa.fi/~ts/> ; FIN-65101, Finland

Useful script files and tricks ftp://garbo.uwasa.fi/pc/link/tscmd.zip

EdP

unread,
Nov 15, 2004, 7:23:25 AM11/15/04
to
foxidrive <foxid...@aanet.com.au> wrote in message news:<8vvqffz8wg3y$.e9tvzv95...@40tude.net>...


I just remember that now! I had an old copy of choice somewhere on my
Windows 2000 resource kit directory on my old computer that I had
forgotten about. I have a new computer now and of course choice is not
there. I will use the set /p command instead.

Thanks all for the replies

EdP

unread,
Nov 15, 2004, 7:26:24 AM11/15/04
to
t...@UWasa.Fi (Timo Salmi) wrote in message news:<cn3tl5$8...@poiju.uwasa.fi>...

Thanks I'll give Choose.exe a try

Bill Stewart

unread,
Nov 15, 2004, 10:28:56 AM11/15/04
to
EdP wrote:

> Anyboy have any idea why choice won't work anymore?

Hi EdP,

Choice is not a standard part of the Windows XP installation, so you'll
need another alternative. Prof. Salmi has a choose.exe, but
unfortunately it's an MS-DOS executable that executes rather slowly on
the NT/2000/XP platform.

I wrote a Win32 console program called getkey.exe that runs much more
quickly and provides the same feature set.

http://home.comcast.net/~stewartb/getkv.html

Regards,

Bill

Till

unread,
Nov 16, 2004, 6:46:23 AM11/16/04
to

Your getkey and getvar exe's are awesome Bill. I just wanted
to give you some praise (: Thankyou for releasing them with
no strings attached, you're a legend in my book (:

--
Till

Bill Stewart

unread,
Nov 16, 2004, 10:17:58 AM11/16/04
to
Till wrote:

> Your getkey and getvar exe's are awesome Bill. I just wanted to give
> you some praise (: Thankyou for releasing them with no strings
> attached, you're a legend in my book (:

Hi Till,

Thanks! Glad they are useful.

Bill

0 new messages