# Boot menu for DOS only



## Grenge (Mar 22, 1999)

I have a special handheld unit which runs on DOS only. 
I want to set up a boot menu so I can run one of two programs on it.
Basicly, it is already setup to run the one program that is there already, automatically. I have just added the second one and would like a choice of the two to come up.

Does anyone know how to do this or direct me to a site that can help. 

The cuurent Autoexec.bat file is as follows

@echo off
PATH=C:;C:\MVR;C:\DOS
ANSI > nul
PROMPT $P$G
echo .
c:
if exist mvrsetup.bat del mvrsetup.bat
rem
rem Added for FS3 PN support
rem
if exist reboot.com del reboot.com
if exist hcard50.exe hcard50 /o
rem
rem
cd mvr
if exist cardoff.exe cardoff
if exist *.?zz mvr_prep /f2
if exist MVR.EXE GOTO BEGIN
if exist fs2com.exe GOTO STARTUP
echo.
echo. Start-up Failed!
echo.
echo. Reload software!
echo.
goto end

:STARTUP
fs2COM
GOTO END

:BEGIN
MVR

:END


The Config.sys is

device=c:\dos\himem.sys
dos=high
files=20
buffers=20


----------



## codejockey (Feb 11, 2002)

You don't say what DOS version you're using. If you're using a recent version (6.2 or so) you might make use of the menu options built in to config.sys. Here's what I do to solve a similar problem (a DOS menu for multi-boot options):

I create a menu of options in my config.sys file; each option corresponds to a labeled section in the config.sys file. In each labeled section, I place the commands specific to that option. The last command of each section sets an environment variable (I use CONFIG) that identifies which option has been chosen.

In my autoexec.bat file, I test the value of the CONFIG environment variable, and then execute the appropriate command.

It sounds a lot more complicated than it is. You might use something like the following:

in config.sys:

```
[MENU]
MENUCOLOR = 7,1
MENUDEFAULT = FS2COM
MENUITEM = FS2COM, RUN FS2COM
MENUITEM = MVR, RUN MVR

[GLOBAL]
FILES=100
DEVICE=C:\WINDOWS\HIMEM.SYS
SHELL=C:\COMMAND.COM C:\ /P /E:512

[FS2COM]
INCLUDE=GLOBAL
DEVICE=C:\WINDOWS\EMM386.EXE NOEMS
DOS=HIGH,UMB
SET CONFIG=FS2COM

[MVR]
INCLUDE=GLOBAL
SET CONFIG=MVR
```
and in autoexec.bat:

```
GOTO %CONFIG%

:FS2COM
if exist reboot.com del reboot.com
if exist hcard50.exe hcard50 /o
FS2COM
GOTO END

:MVR
cd mvr
if exist cardoff.exe cardoff
if exist *.?zz mvr_prep /f2
MVR
GOTO END

:END
```
I probably didn't get things exactly right (I just did it off the top of my head), but hopefully this will give you the idea of the general approach.

Hope this helps.


----------



## Grenge (Mar 22, 1999)

I'm not sure what version I have. The attributes of the files won't help either because the handheld unit changes the date to when it was downloaded onto itself.


----------



## codejockey (Feb 11, 2002)

If memory serves, you can use the ver command to report the DOS version. Note that you will have to execute this command in a real DOS environment, not a DOS window under Windoze (since it reports the Windoze version instead of the DOS version). Worst case: you can try modifying your config.sys file (save your original first!) and see if the menu option is supported. 

If you are running an older version of DOS, post back and we'll sort things out from there.

Hope this helps -- additional info appreciated.


----------



## Grenge (Mar 22, 1999)

I used the ver command and it is v6.22
I noticed that you seem to have split the Autoexec.bat in half. The original I posted was for the one program on the unit. The second program I have added is C:\MVP\MVP.exe The first program was MVR.
I tried running what you gave me above and I got an error as shown below,
"Error in CONFIG.SYS line 4"
Then it goes to the menu which only has the second program "MVP" and when I run "MVP" it actually runs MVR.


----------



## codejockey (Feb 11, 2002)

Your DOS version will support the menu option in config.sys, so you should be fine there. Not sure why you are getting a syntax error, but if you use the F8 key at boot, you can choose to step through each statement and identify exactly the statement that fails (which is line 4?). 

The autoexec.bat file is all one file that contains different labels, one label per program to be run, plus a label for a common end routine. I may have left some things out, and undoubtedly I didn't fully understand what you were trying to do with each option. However, I don't see where MVP appears at all in your autoexec.bat, so that's probably one source of confusion on my part. 

Regardless, I'm happy to sort it out. If you can provide a listing of the steps for executing each program, I'll see what I can do to generate the config.sys and autoexec.bat files, and you can see if they work they way you have in mind.


----------



## Grenge (Mar 22, 1999)

Sorry. I'm not too knowlegable with the DOS commands in these files.
MVP wasn't in the files shown above because they are the files that were on the unit before I put MVP on it. and the path for MVP is now C:\MVP\MVP.exe
I don't seem to be able to press F8 to step through. It is a handheld unit that is used to read meters but has a hard drive and runs on DOS. There are only F1-4 and I don't think pressing shift + F4 gives me F8. I think line 4 is "MENUITEM = FS2COM, RUN FS2COM"


----------



## codejockey (Feb 11, 2002)

No problem -- I was confused because I thought the two programs to be executed were MVR and FS2COM (I didn't realize you hadn't included the second program, MVP). So, I think you will need something like this:

in config.sys:

```
[MENU]
MENUCOLOR = 7,1
MENUDEFAULT = MVR,30
MENUITEM = MVP, RUN MVP
MENUITEM = MVR, RUN MVR

[GLOBAL]
FILES=100
DEVICE=C:\WINDOWS\HIMEM.SYS
SHELL=C:\COMMAND.COM C:\ /P /E:512

[MVR]
INCLUDE=GLOBAL
SET CONFIG=MVR

[MVP]
INCLUDE=GLOBAL
SET CONFIG=MVP
```
and in autoexec.bat:

```
@echo off
PATH=C:;C:\MVR;C:\MVP;C:\DOS
ANSI > nul
PROMPT $P$G
echo .
c:
GOTO %CONFIG%

:MVR
if exist mvrsetup.bat del mvrsetup.bat
rem
rem Added for FS3 PN support
rem
if exist reboot.com del reboot.com
if exist hcard50.exe hcard50 /o
rem
rem
cd mvr
if exist cardoff.exe cardoff
if exist *.?zz mvr_prep /f2
if exist MVR.EXE GOTO BEGIN
if exist fs2com.exe GOTO STARTUP
echo.
echo. Start-up Failed!
echo.
echo. Reload software!
echo.
goto end

:STARTUP
fs2COM
GOTO END

:BEGIN
MVR

:MVP
C:
CD \MVP
MVP
GOTO END

:END
```
Note that you may need to add commands to the :MVP section if the MVP program needs initializations performed, etc.

Hope this helps.


----------



## Grenge (Mar 22, 1999)

Thanks! That did the job.
I just had to remove the line "DEVICE=C:\WINDOWS\HIMEM.SYS" because windows isn't on the handheld device and it was giving me an error that it wasn't there.


----------



## codejockey (Feb 11, 2002)

You're welcome -- glad to hear things are sorted out. I should have caught the windows reference, but fortunately, you spotted the problem.


----------

