I want to use the "choice" command in a batch file that is run from a
boot floppy.
If the batch program runs, I get a "bad command" error if the machine
boots from the floppy.
If the batch program runs from booting off of the hard drive, it works
fine.
The boot floppy was made from the same machine in question and the
versions of DOS are the same.
What is missing on the boot floppy that makes this fail?
I am not a news hound, so I would appreciate an email reply, this one has
me stumped.
James Ervin
The City of Bedford
ja...@cablenet-va.com
-------------------==== Posted via Deja News ====-----------------------
http://www.dejanews.com/ Search, Read, Post to Usenet
This is an easy one :-)
You need a PATH statement to make Dos look in the right direction for
it's external CHOICE command.
Make sure your batch file contains a full path for CHOICE, like
c:\dos\choice, or make a PATH= statement in an AUTOEXEC.BAT on your
floppy: PATH=C:\DOS
Greetings
Per
>If the batch program runs, I get a "bad command" error if the machine
>boots from the floppy.
Either copy CHOICE.COM to the floppy or set a PATH to C:\DOS before
calling this file.
(tm)
On Fri, 02 May 1997 21:51:27 -0600, ja...@cablenet-va.com of Deja News
Usenet Posting Service wrote:
>I want to use the "choice" command in a batch file that is run from a
>boot floppy.
>
>If the batch program runs, I get a "bad command" error if the machine
>boots from the floppy.
>
>If the batch program runs from booting off of the hard drive, it works
>fine.
Show us the batch file and the CONFIG.SYS and AUTOEXEC.BAT files from both
the floppy and your hard disk.
I guess there is no path pointing to CHOICE.COM . So, either establish a
path or, better, invoke CHOICE with a fully qualified file name.
>I am not a news hound, so I would appreciate an email reply, this one has
>me stumped.
Bad netiquette.
--
Michael Bednarek, Computer Support, Grafton Base Hospital
Arthur St, Grafton 2460, Australia. Ph:+61 66 402471, Fx:+61 66 402444
Supervi...@doh.health.nsw.gov.au "POST NO BILLS"
James, as far as I know, MS-DOS does not include a choice command. I
would guess you have the location of a command called choice.com or
choice.exe in your path when you boot from your hard drive, but don't
have the same path booting from floppy. Find the choice file and add
it's path to the floppy autoexec.bat
Hope this helps.
___________________________________
Rob Stewart - SE Net Tech. Support
http://www.senet.com.au
ro...@senet.com.au
Well Rob, I guess I'll just have to delete the choice.com that came with
MS-DOS 6.22 (MS-DOS 6.0 and 6.2 also) so that your answer would then be
correct <G>.
-=Dave=-
Of course it does. Look in your DOS directory. Or try HELP CHOICE.
Tech. Support, eh?
:Of course it does.
Yes, provided one has MS-DOS version 6+.
:Look in your DOS directory. Or try HELP CHOICE.
For the earlier versions you can use e.g. CHOOSE.EXE which has the
same functionality.
ftp://garbo.uwasa.fi/pc/ts/tsutlf15.zip Sixth set of Utilities, T.Salmi
Filename Comment Date Time
-------- -------------------------------- ---- ----
ADVDATE.EXE Advance system clock's date 07-27-95 12:30:34
CHOOSE.EXE Ask questions in batch files 07-27-95 12:33:46 <-----
CHTEST.BAT An example of using CHOOSE.EXE 08-07-93 14:17:54
DELEDIR.EXE Generalized delete directory 07-27-95 07:18:44
FILE_ID.DIZ Brief characterization of TSUTLF 07-27-95 00:22:44
GOTODIR.EXE Generalized change directory 07-27-95 07:18:32
MAKEDIR.EXE Generalized create directory 07-27-95 07:18:38
STRINGS.EXE Find a file's embedded strings 07-27-95 12:36:26
STRMEMO.EXE Find strings in your PC's memory 07-27-95 12:38:58
TSPROG.INF List of PD programs from T.Salmi 07-05-95 11:39:10
TSUTLF.INF Document (a readme) 07-27-95 07:21:28
TSUTLF.NWS News announcements about tsutlf 07-27-95 07:11:26
VAASA.INF Info: Finland, Vaasa, U of Vaasa 06-29-95 10:05:12
---- ------ ------ -----
0013 113663
All the best, Timo
....................................................................
Prof. Timo Salmi Co-moderator of news:comp.archives.msdos.announce
Moderating at ftp:// & http://garbo.uwasa.fi archives 193.166.120.5
Department of Accounting and Business Finance ; University of Vaasa
mailto:t...@uwasa.fi <URL:http://uwasa.fi/~ts> ; FIN-65101, Finland
It includes BUT IT DOESN'T WORK
I have some BAT
@echo off
:start
echo 1 - 111.exe
echo 2 - 222.exe
echo 3 - 333.exe
echo 4 - exit
choice /c:1234 "Make your choice : "
if errorlevel 1 111.exe
if errorlevel 2 222.exe
if errorlevel 3 333.exe
if errorlevel 4 goto outta
goto start
:outta
Doesn't matter what I choose it always selects 111.exe and returns to
main
menu. This batch file work perfectly under DOS 6.22 and NDOS (4DOS)
shell.
Under DOS 7 | Win95 it doesn't work !!!
What I have to do ??? HELP !!!
Ian
PS: please reply by e-mail mailto://ia...@tmx100.elex.co.il
I don't see how the batch file above could possibly work in DOS 6.22.
The problem is in understanding what the ERRORLEVEL test really means.
It does NOT test for the errorlevel being EQUAL to the number, it test
to see if it is equal to or GREATER than the number. Therefore if the
errorlevel is 2 the test
'IF ERRORLEVEL 1' is TRUE (as well as 'IF ERRORLEVEL 2').
The answer is to reverse the order of the tests. Always test from the
HIGHEST value to the lowest. Also realize that an ERRORLEVEL of zero is
returned if the user presses the control-Break. That means the the line
following the test for ERRORLEVEL 1 should be designed to handle such an
eventuality.
Tom Lavedas
-----------
Delta Electronics, Inc.
http://www.deltaelectronics.com/tglbatch/
Try reverting the order of these lines!
On Wed, 14 May 1997 08:07:42 GMT, John <ia...@tmx100.elex.co.il> of Telrad
Ltd. wrote:
>Michael Bednarek wrote:
>> On Tue, 06 May 1997 02:34:29 GMT, ro...@senet.com.au (Rob Stewart) of SE
>> Network Access wrote:
>> >James, as far as I know, MS-DOS does not include a choice command.
>> Of course it does. Look in your DOS directory. Or try HELP CHOICE.
>It includes BUT IT DOESN'T WORK
No need to yell.
>@echo off
>:start
>echo 1 - 111.exe
>echo 2 - 222.exe
>echo 3 - 333.exe
>echo 4 - exit
>choice /c:1234 "Make your choice : "
>if errorlevel 1 111.exe
>if errorlevel 2 222.exe
>if errorlevel 3 333.exe
>if errorlevel 4 goto outta
>goto start
>:outta
>
>Doesn't matter what I choose it always selects 111.exe and returns to
>main menu. This batch file work perfectly under DOS 6.22 and NDOS (4DOS)
>shell. Under DOS 7 | Win95 it doesn't work !!!
>
>PS: please reply by e-mail mailto://ia...@tmx100.elex.co.il
Bad netiquette.
I'm prepared to bet large sums of money that the batch file above does not
run as you expect under COMMAND.COM, 4DOS , or any command processor. It
will always run 111.EXE.
Read what HELP has to say on IF.
>John <ia...@tmx100.elex.co.il> writes:
> I have some BAT
> @echo off
> :start
> echo 1 - 111.exe
> echo 2 - 222.exe
> echo 3 - 333.exe
> echo 4 - exit
> choice /c:1234 "Make your choice : "
> if errorlevel 1 111.exe
> if errorlevel 2 222.exe
> if errorlevel 3 333.exe
> if errorlevel 4 goto outta
> goto start
> :outta
>
> Doesn't matter what I choose it always selects 111.exe
> and returns to main menu. This batch file work perfectly
> under DOS 6.22 and NDOS (4DOS) shell.
> Under DOS 7 | Win95 it doesn't work !!!
>
> What I have to do ??? HELP !!!
you need to put the highest ERRORLEVEL first. simple as that.
-Jason