I am busy making my automated DOS scripts run and for Win7 switched to the CHOICE command (the dear old Wait.COM 16-bit utility won't run under Win7/64 bit).
This morning to the IBM/WinXPSP3 machine ... only to find that CHOICE is unavailable in WinXP.
It is available in predecessors and successors, but not in Win XP.
How do they know what I want?
http://www.computerhope.com/choicehl.htm :-
Availability
The choice command is an external command and is available in
MS-DOS 6.0+
Windows 95
Windows 98
Windows Vista
Windows 7
(The chosen colour is as close as I could get to funereal purple)
"CHOICE" command absent
-
- PlutoniumLounger
- Posts: 15641
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
"CHOICE" command absent
He who plants a seed, plants life.
-
- PlatinumLounger
- Posts: 5411
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: "CHOICE" command absent
Code: Select all
@echo off
setlocal
:loop
set /p answer="Does this do a similar thing to that which CHOICE used to do? "
if "%answer%"=="" echo Answer y or n please! & goto loop
if /i "%answer%"=="y" echo Yes, much the same & endlocal & goto :eof
if /i "%answer%"=="n" echo I'll bet you're Chris Greaves!! & endlocal & goto :eof
echo Answer y or n please! & goto loop
John Gray
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
-
- GoldLounger
- Posts: 3081
- Joined: 24 Jan 2010, 19:07
Re: "CHOICE" command absent
Since Windows 2000, same in XP, the SET command has some new switches; in this case /P (prompts for user input; sets the value of the variable to a line of input entered by the user) can be of some interest. As mentioned in the pages you linked to, and as shown in a very, ehm, straightforward way by John.
Another example: DOS Choice command replacement (from a random site; also shows the IF /I switch, used by John).
I think they removed CHOICE and put it in a resource kit, then included it (a different version) again.
Another example: DOS Choice command replacement (from a random site; also shows the IF /I switch, used by John).
I think they removed CHOICE and put it in a resource kit, then included it (a different version) again.
Byelingual When you speak two languages but start losing vocabulary in both of them.
-
- PlutoniumLounger
- Posts: 15641
- Joined: 24 Jan 2010, 23:23
- Location: brings.slot.perky
Re: "CHOICE" command absent
John, thanks for this. I'll take a look at it. (I'm sure you've tested it, though!).John Gray wrote:Does this do a similar thing to that which CHOICE used to do?
My use of CHOICE was spurred by a web page that made use of CHOICE to implement a WAIT command.
In the meantime I test for the operating system version and use either the 16-bit Wait.COM or the Choice command, depending on.
I know I complain, but I struggle to comprehend why, with a GB Operating System, MSoft drops items that are of use. I shudder to think of the man-hours burned up building workarounds in each new version of anything.
He who plants a seed, plants life.
-
- GoldLounger
- Posts: 3081
- Joined: 24 Jan 2010, 19:07
Re: "CHOICE" command absent
I don't know, I haven't looked closer at this, but see this for example. Items may be of use, but not work optimally, and if the environment (OS) changes ...ChrisGreaves wrote:[...]I struggle to comprehend why, with a GB Operating System, MSoft drops items that are of use. I shudder to think of the man-hours burned up building workarounds in each new version of anything.
Availability
Choice.com was originally supplied on the Windows 95 install CD, however there are some issues with this version under NT - multiple concurrent invocations of CHOICE will clobber each other. CHOICE.com will also burn a lot of CPU's when in a wait state.
The NT and 2000 Resource Kits contain CHOICE.EXE which behaves a lot better.
In Windows 2003 CHOICE became a built-in command so it is no longer in the resource kit.
Byelingual When you speak two languages but start losing vocabulary in both of them.
-
- PlatinumLounger
- Posts: 5411
- Joined: 24 Jan 2010, 08:33
- Location: A cathedral city in England
Re: "CHOICE" command absent
Chris
The standard WAIT command is PING -n 6 127.0.0.1 > nul where the value 6 is one more than the number of seconds to be waited, viz. 5.
Put 13 for a wait of 12 seconds, and so on. (Think of the PING number as the number of fence posts, thus giving n-1 fence panels = seconds in-between.)
The standard WAIT command is PING -n 6 127.0.0.1 > nul where the value 6 is one more than the number of seconds to be waited, viz. 5.
Put 13 for a wait of 12 seconds, and so on. (Think of the PING number as the number of fence posts, thus giving n-1 fence panels = seconds in-between.)
John Gray
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...
"(or one of the team)" - how your hospital appointment letter indicates that you won't be seeing the Consultant...