Tom's Guide | Tom's Hardware | Tom's Games
![]() |
![]() |
![]() |
I have a batch file that needs to use Choice.exe on XP/Vista..
The problem is:
a)Find a Choice.exe that works for both
b)Test the runtime OS for Vista/XP and change the Choice command to suit???
Vista x64
Works without Choice.exe being present in .bat location, but throws an error if Choice.exe(1.71KB ~ XP requires) is present in .bat dirXP x32
Needs Choice.exe(1.71KB) in the .bat dir, but throw an error if Choice.exe's found in Vista install are used
Choice.exe 37KB
Choice.exe 30KBErrors being thrown are related to compatibility
Warning Batch Newbie:
Thanks For Being Patient!
Any Help Is Appreciated!

FWIW I use choice.com from DOS 6.22 in W2K.
No errors.
1,754 bytes
=====================================
If at first you don't succeed, you're about average.M2

This is similar to the errors I recieved with Choice.exe
Choice.com 1,754 bytes
Vista x64 error:
"This version of C:\Users\V1\Desktop\PROFILER\DATA\CHOICE.COM is not compatible with the version of Windows you're running. Check your computer's system information to see whether you need a x86 (32-bit) or x64 (64-bit) version of the program, and then contact the software publisher."
I can right-click choice.com but there is no compatibility tab available...
-----------Just to clarify what i posted before, Im not sure this is even possible with 'Choice.exe':
I have one version of choice.exe that works with XP and another version that works with Vista,
If I include both versions in my .bat folder(seperate folders) is it possible for the batch file to use the right choice.exe based on the OS at runtime..something like
If vista detected CD %vistaChoiceLoc% else
If XP detected CD %XPchoiceLoc%
choice /N /C:Warning Batch Newbie:
Thanks For Being Patient!
Any Help Is Appreciated!

W2K has this var bilt in:
OS=Windows_NT
With luck, maybe XP & vista do too. If so:
if %OS%==XP c:\a\choice
if %OS%==vista c:\b\choice
=====================================
If at first you don't succeed, you're about average.M2

Vista (and I think XP) x64 have eliminated support for 16-bit programs. This includes CHOICE.exe. I personally suggest just using SET /P, but that's just me.
As far as detection goes, you could probably use a VBScript to run a WMI query, but I would understand if you didn't want to. The solution I came up with, but was never very happy with, is this:
systeminfo | find "x64" &&set sys=64||set sys=32

"Vista (and I think XP) x64 have eliminated support for 16-bit programs"
adios, backward compatibility
=====================================
If at first you don't succeed, you're about average.M2

Mechanix2Go: adios, backward compatibility
Hey now, it still supports 32-bit. You have nothing to complain about.

I was having trouble with SET & GOTO inside brackets, which is how I came across choice.exe via IVO..even if I could use SET somehow it would be a bit of a rewrite at this stage..
Thinking of the type of tasks that batch seems good for, its hard to understand why M$ woudn't have a choice.exe that works across all their currently supported OS's, well at least XP-->VISTA..I mean what if your batching across 1000 pc's with a mixture of Windows versions.
..maybe it's just another little shoehorn to help us all into our 'Vista Licence'
-------Anyway what about this for detection, too tired to test now(3:18am), but would be interested to hear what you guys think:
ver | find "Microsoft Windows [Version 5.1.2600]"
IF NOT errorlevel 1 (
echo Windows XP SP2, SP3)ver | find "Microsoft Windows [Version 5.2.3790]"
IF NOT errorlevel 1 (
echo Windows XP Professional x64 Edition or Windows Server 2003 or Windows XP 64-bit Edition 2003)ver | find "Microsoft Windows [Version 6.0.6000]"
IF NOT errorlevel 1 (
echo Windows Vista)ver | find "Microsoft Windows [Version 6.0.6001]"
IF NOT errorlevel 1 (
echo Windows Vista SP1)Thanks as always for all your previous inputs
Warning Batch Newbie:
Thanks For Being Patient!
Any Help Is Appreciated!

I think Vista 32-bit would still support the same version of CHOICE.exe as WinXP. Therefore, your solution is the right answer to the wrong question.

%OS%
Returns the same value in XP and Vista
Value: "Windows_NT"SET /P
If the user inputs an invalid value, is there a way to restart the input loop without using GOTO?"I think Vista 32-bit....."
I cant test for this, might be safer to assume 1 Choice.exe for Vista and another for XPps
a)Find a Choice.exe that works for both
b)Test the runtime OS for Vista/XP and change the Choice command to suit???Warning Batch Newbie:
Thanks For Being Patient!
Any Help Is Appreciated!

I cant test for this, might be safer to assume 1 Choice.exe for Vista and another for XP
You're aready assuming two things: 1) You will never encounter 32-bit Vista. 2) You will never encounter any Windows 64-bit OS besides Vista (Including WinXP x64, Windows 7 x64, and related Windows server OSes).

hmmn good point razor..hopefully this batch will only be relevant on XPx32 Vistax32, x64
I was kinda hoping if Choice.exe works on Vista x64 then it should also work on Vistax32, but as you point out..there may still be compatibility issues x32-->x64
ATM I only have XPx32 and Vistax64 to test on, if I can make it work on these 2, I can maybe expand my solution as I encounter problems during final testing...
'backwards compatibility' what about 'sideways compatibility'Warning Batch Newbie:
Thanks For Being Patient!
Any Help Is Appreciated!

![]() |
batch: ..get dir 1 levl u...
|
SQL Query
|

This post is quite old and has been locked from receiving new replies. Please create a new posting instead.
| Ads by Google |