×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!
  • Students Click Here

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

choice.com and winnt

choice.com and winnt

choice.com and winnt

(OP)
Has windows NT removed the command CHOICE.COM ???
If so, is there a similiar command that can be used in Win2000/NT????????

RE: choice.com and winnt

I didn't know that NT had Choice.  If you have DOS 5, 6 or Win 95/98/ME then you should be able to find it.

I'm not certain on XP though.
--MiggyD

NOTE:
In Win 95/98/ME it's in the (windows)\COMMAND folder.
In DOS it's obviously in the DOS folder (or use EXTRACT to get it out of the OEM disketts.)

RE: choice.com and winnt

Create your own Choice.com. Since this is a BASIC forum, I guess this is appropriate....

Use Quick Basic 4.5 or higher:

' Start QB with the /l qb.qlb parameters....
' Create a program with this code and compile it
'    as MYCHOICE.EXE
DECLARE SUB Bye CDECL ALIAS "_exit" (BYVAL RetVal%)
C$ = COMMAND$
IF C$ = "" THEN
    PRINT "Tap a key. A value will be returned in ERRORLEVEL. ";
ELSE
    PRINT C$;
END IF
DO
    I$ = INKEY$
    IF I$ <> "" THEN
    ' Subtract 64 from the ASCII value
    ' of the key press.
    ' "A" will return 1, "B" returns 2, etc.
        RetVal% = ASC(I$) - 64
        EXIT DO
    END IF
LOOP
Bye RetVal%

Then create a batch file to use MYCHOICE.EXE....
@ECHO OFF
echo CAPSLOCK should be ON
MYCHOICE Select A, B or C (A,B,C)?
IF ERRORLEVEL 3 GOTO Cpressed
IF ERRORLEVEL 2 GOTO Bpressed
IF ERRORLEVEL 1 GOTO Apressed
GOTO Done
:Cpressed
ECHO C WAS PRESSED
GOTO DONE
:Bpressed
ECHO B WAS PRESSED
GOTO DONE
:Apressed
ECHO A WAS PRESSED
:Done


RE: choice.com and winnt

(OP)
What I meant was, did Windows NT stop using choice.com
I was always able to use it in Dos and win9x but not in Win NT.

RE: choice.com and winnt

That sounds like a purely academic question. Are you interested in trapping and passing keystrokes or do you just want to know why Microsoft didn't include the 16-bit utilities when it shipped NT?


Do no harm.

RE: choice.com and winnt

I'm sitting in front of a Windows NT4 SP6a machine and CHOICE works here.

Here's text captured from the DOS window...

Microsoft(R) Windows NT(TM)
(C) Copyright 1985-1996 Microsoft Corp.

C:\>choice /?
CHOICE [/C[:]choices] [/N] [/S] [/T[:]c,nn] [text]

/C[:]choices Specifies allowable keys. Default is YN
/N           Do not display choices and ? at end of prompt string.
/S           Treat choice keys as case sensitive.
/T[:]c,nn    Default choice to c after nn seconds
text         Prompt string to display

ERRORLEVEL is set to offset of key user presses in choices.



C:\>ver

Windows NT Version 4.0

C:\>ver


 - Chuck Somerville

RE: choice.com and winnt

Hi,

No, "choice" is not part of Windows any more.
SET /P is way to go.

Type command line command:
SET /?
and scroll down till section
SET /P variable=[promptString]

It is up to you how to develop the solution.

Happy reading and good luck.
vjc000.

RE: choice.com and winnt

typical choice code below:

SET Q=Y
:QUERY
set /p Q=Do you want to install?: Y
if /i %Q% equ n goto end
if /i %Q% equ y (command XXX) ELSE GOTO LOERROR
GOTO end
:LOERROR
ECHO INVALID RESPONSE
SET Q=Y
goto :QUERY
:end

RE: choice.com and winnt

(OP)
OK, thanks, sorry I didnt understand before, I was actually meaning win2k...
I had just been trying to use choice for a batch file and was confused then as to why I couldnt, but now I know...

I will try that set /? then...


on error goto www.tek-tips.com

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close