Computing.Net > Forums > Windows NT > NT cmd - choice

Computer Problems? Computing.Net has over 1,000,000 posts about all things technology related! Over 90% answered within 24 hours! Click here to start participating now! Also, be sure to check out the New User Guide.

NT cmd - choice

Reply to Message Icon

Name: SING MENG
Date: August 8, 2003 at 00:07:49 Pacific
OS: NT
CPU/Ram: 256
Comment:

Does anyone know how to make use of choice command (Dos7) in NT cmd?

Eg,
Choice /c:yn /t:y,3 Hey! Master. Do you want to add it into index file?

Ur feedback is important to me. Thanks



Sponsored Link
Ads by Google

Response Number 1
Name: MikeBrewer
Date: August 9, 2003 at 03:57:20 Pacific
Reply:

Choice /c:yn /t:y,3 Hey! Master. Do you want to add it into index file?
---
Check for errorlevel right after the choice statement.
if errorlevel==2 goto no-add
if errorlevel==1 goto yes-adit

Errorlevel is determined by which one of the characters following the "/c:" option you choose.
If you chose the 2nd choice, "n", then you can have it jump to the instructions following ":no-add" in your batch file.
You can have more than two - /c:YNM
Then you would have to check ...
if errorlevel==3 goto maybe-ad
Remember to start with the largest errorlevel number and work down - 3,2,1 or
it may not work right.

The "/t:" parameter is GREAT!
"/t:y,3" means after "3" seconds, pretend the user chose "y".



0
Reply to Message Icon

Related Posts

See More







Post Locked

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


Go to Windows NT Forum Home


Sponsored links

Ads by Google


Results for: NT cmd - choice

NT cmd file locking www.computing.net/answers/windows-nt/nt-cmd-file-locking/10670.html

dual boot NT and 95 www.computing.net/answers/windows-nt/dual-boot-nt-and-95/3898.html

Disk Administrator is Grayed out On NT www.computing.net/answers/windows-nt/disk-administrator-is-grayed-out-on-nt/5175.html