i am looking for a batch command choice.com for WinXP

Discussion forum for all Windows batch related topics.

Moderator: DosItHelp

Post Reply
Message
Author
nnnmmm
Posts: 188
Joined: 26 Aug 2017 06:11

i am looking for a batch command choice.com for WinXP

#1 Post by nnnmmm » 30 Aug 2025 01:35

AA=choice /C:1234567890abcdefghijklmnopqrstuvwxyz /N /M "Input:"
BB=choice /C:1234567890abcdefghijklmnopqrstuvwxyz /N "Input:"

BB's choice.com is from DOS6.22
AA works for Win10, but XP doesnt have the choice command

to make it work in XP, i used DOS 6.22's choice.com
but DOS 6.22's choice.com causes an error with /M switch

in order to avoid adding and using this complication "IF DEFINED Public () ELSE ()" everywhere in 1000s batches

is there a someone's assembler's choice.com that can do and also handle ErrorLevel correctly?

elzooilogico
Posts: 131
Joined: 23 May 2016 15:39
Location: Spain

Re: i am looking for a batch command choice.com for WinXP

#2 Post by elzooilogico » 30 Aug 2025 04:06

As far as I may remember, there's a Xp choice compatible version in the Win Server 2003 SDK

nnnmmm
Posts: 188
Joined: 26 Aug 2017 06:11

Re: i am looking for a batch command choice.com for WinXP

#3 Post by nnnmmm » 30 Aug 2025 06:21

choice.com from Utilidades.zip didnt do what i needed, it had the same syntax switches as DOS6.22's choice.com

i need DOS or XP's choice.com that can do choice /C:1234567890abcdefghijklmnopqrstuvwxyz /N /M "Input:"
or i need to separate the XP and Win10 batches, that is the last thing i want to do

if it is not much trouble with you,
might you be interested in making a choice.com with the assembler?

i downloaded the ISO Win Server 2003 SDK from MS site, but the ISO had all cab files, choice.com was unidentifiable in there, this will take an indefinitely long time

i still need to solve the another problem of esc[1:32m in XP
to be about 95% compatible with Win10 batches

choice was used in my 1000s batches
esc[1:32m was used in 50,000 lines in 1000s batches
i will try to use string replacer.exe to separate XP and Win10
but adding ...if defined public... else .... is a different matter, which i cant do that with string replacer

i tried ansicon... i will think about more purpose later, initially ansicon didnt cut it, i have about 1000 batches in ZTree's ZAM format, they all work inside Ztree, which is the same as the XTree's batch menu, it is not like a filename.bat, it is the collection of batches with some chr$(0) chr$(0) chr$(0) or ascii code 0 at the each end of the batches and that makes ZAM a binary file.

but if you might could would find the way to install ansi.sys in XP or any 3rd party way to install ansi.dll in XP, please let me know

jeb
Expert
Posts: 1064
Joined: 30 Aug 2007 08:05
Location: Germany, Bochum

Re: i am looking for a batch command choice.com for WinXP

#4 Post by jeb » 30 Aug 2025 07:40

You can write and use a separate choice.bat file in XP.
This will be executed, when there is no choice.exe file is found.

The choice batch file itself can use the xcopy or replace technique to get the input key value.

Read key presses via REPLACE - New functions :getKey, :getAnyKey, :getMaskedInput

jeb

Post Reply