There's no such thing as a stupid question, but they're the easiest to answer.
JoinTour
Login
 
Tag Cloud
access audio avg avg 8 bios blue screen boot bsod computer connection cpu crash css dell desktop dma driver drivers dvd email error excel explorer firefox firefox 3 freeze gimp graphics hard drive hardware hijackthis hjt install internet internet explorer itunes keyboard laptop macro malware monitor motherboard network networking outlook outlook 2003 outlook 2007 outlook express pio problem problems router seo server slow sound sp3 spyware trojan usb video virtumonde virus vista vundo windows windows vista windows xp winxp wireless
DOS/PDA/Other
Search
Search in:
 
Advanced Search
Tech Support Guy Forums > Operating Systems > DOS/PDA/Other >
Choice Command


HELLO AND WELCOME! Before you can post your question, you'll have to register -- it's completely free! Click here to join today! We highly recommend that you print a copy of our Guide for New Members. Enjoy!

 
Thread Tools
MooseI386's Avatar
Junior Member with 10 posts.
 
Join Date: Dec 2005
Experience: Advanced
27-Dec-2005, 11:33 AM #1
Choice Command
I have been trying to consolidate several programs onto a USB Bootable hard drive. I have been using the Choice command in the Autoexec.bat file to give me a choice of what programs to start. However choice is only returning errorlevel 1; no matter what number I push. Any ideals? Work in progress.

Not I use a second choice to allow a 20 sec time so I may see what Echo measage is displayed. However no matter what I push I always Get
Starting Re-image 1

@ECHO OFF
:START
CLS
ECHO -------Enter Number-------------

ECHO 1- Image PC with XP image.
ECHO 2- Image PC with 2000 image.
ECHO 3- Load Ghost 2003.
ECHO 4- Load Techie's Toolkit.
ECHO 5- Load ERD Commander.
ECHO 6- Start Computer with CD-ROM Support.
ECHO 7- Start Computer without CD-ROM Support.
ECHO 8- Run GDISK to delete all partitions.
ECHO 9- Load Drive Scrubber for DOD Cleaning.

ECHO -------Enter Number-------------

ECHO OFF

CHOICE /N /C:123456789W /T:W,20 Select a number (Windows will start in 20sec)%1


IF ERRORLEVEL 1 GOTO XP
IF ERRORLEVEL 2 GOTO 2000
IF ERRORLEVEL 3 GOTO GHOST
IF ERRORLEVEL 4 GOTO TOOLKIT
IF ERRORLEVEL 5 GOTO ERD
IF ERRORLEVEL 6 GOTO CD
IF ERRORLEVEL 7 GOTO NOCD
IF ERRORLEVEL 8 GOTO GDISK
IF ERRORLEVEL 9 GOTO DSCRUB
IF ERRORLEVEL w GOTO WIN

REM ------------1------------------------------
:XP
ECHO Starting Re-image 1

CHOICE /N /C:Z,M /T:M,20 Will start over in 20 sec
IF ERRORLEVEL Z GOTO OVER
IF ERRORLEVEL M GOTO OVER2
:OVER
ECHO START OVER
GOTO START
:OVER2
ECHO START OVER
GOTO START

REM -------------2-----------------------------
:2000
ECHO Starting Re-image 2

CHOICE /N /C:Z,M /T:M,20 Will start over in 20 sec
IF ERRORLEVEL Z GOTO OVER
IF ERRORLEVEL M GOTO OVER2
:OVER
ECHO START OVER
GOTO START
:OVER2
ECHO START OVER
GOTO START

------------------------------------------------------------------------------------
AND SO ON AND SO ON

:END
Rockn's Avatar
Computer Specs
Distinguished Member with 17,888 posts.
 
Join Date: Jul 2001
Location: Mexico of the North, MN
Experience: Disenfranchised American Male
30-Dec-2005, 12:14 PM #2
You need to be loading command.com for the boot device to be able to initialize and use CHOICE. You also need all of the files like CHOICE, command.com, etc. on the boot device along with a path statement added to your autoexec.bat file pointing to the folder.
__________________
**Disclaimer** Anything below this line ^ is part of my signature for those that may be confused

Sadly, there are no integers on this scale, so your gangly adolescent attempt to be clever has proved futile....Dieter

I have the right "NOT" to be tolerant of others because they are different, weird, or tick me off.....Parody of Andy Rooney

There are no stupid questions, but there are a LOT of inquisitive idiots.
Dan Penny's Avatar
Senior Member with 405 posts.
 
Join Date: Mar 2005
Location: Alberta - Canada
Experience: Enough
31-Dec-2005, 08:50 AM #3
ERRORLEVEL parameters _
_
The first key you assign returns a value of 1, the second a value of 2, the _
third a value of 3, and so on. If the user presses a key that is not among _
the keys you assigned, CHOICE sounds a warning beep (that is, it sends a _
BEL, or 07h, character to the console). _
_
If CHOICE detects an error condition, it returns an ERRORLEVEL value of 255. _
If the user presses CTRL+BREAK or CTRL+C, CHOICE returns an ERRORLEVEL value _
of 0. _
_
When you use ERRORLEVEL parameters in a batch program, list them in _
decreasing order.



Thus;

IF ERRORLEVEL w GOTO WIN
IF ERRORLEVEL 9 GOTO DSCRUB
IF ERRORLEVEL 8 GOTO GDISK
IF ERRORLEVEL 7 GOTO NOCD
IF ERRORLEVEL 6 GOTO CD
IF ERRORLEVEL 5 GOTO ERD
IF ERRORLEVEL 4 GOTO TOOLKIT
IF ERRORLEVEL 3 GOTO GHOST
IF ERRORLEVEL 2 GOTO 2000
IF ERRORLEVEL 1 GOTO XP
__________________
It's a good day when you learn something
Reply


Currently Active Users Viewing This Thread: 1 (0 members and 1 guests)
 
Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are Off
Refbacks are Off

You Are Using:
Server ID
Advertisements do not imply our endorsement of that product or service.
All times are GMT -4. The time now is 06:29 PM.
Copyright © 1996 - 2008 TechGuy, Inc. All rights reserved.
Powered by vBulletin, Copyright © 2000 - 2008, Jelsoft Enterprises Ltd.
Search Engine Optimization by vBSEO 3.1.0
Powered by Cermak Technologies, Inc.