# How do I create a boot menu to select between Windows and DOS?

I was not a PC user before Windows 98. But I remember one of my friends was using a boot menu in his 486 machine to select between Windows/DOS.

1. EMS
2. XMS
3. Windows


If we would be playing games, we would pick the EMS or XMS option. If we would play SimCity or Command & Conquer, we would pick Windows. To actually enter into Windows (3.1) we had to manually enter the WIN command after picking option 3.

Was this menu implemented in autoexec.bat or config.sys? What would be the difference of the Windows mode? Does anyone have any example of this kind of menu?

Assuming this was a PC running MS-DOS 6 or later, this would typically be implemented using a CONFIG.SYS menu:

[MENU]

[COMMON]
DEVICE=C:\DOS\HIMEM.SYS

[EMS]
DEVICE=C:\DOS\EMM386.EXE

[XMS]

[Windows]


with appropriate settings in the [XMS] and [Windows] blocks. The [COMMON] block is taken into account in all cases, as long as it comes first; it can be repeated if necessary.

The AUTOEXEC.BAT can use the %CONFIG% variable to adjust its behaviour depending on the chosen entry:

@ECHO OFF
:: Common startup here
GOTO %CONFIG%

:EMS
:: EMS-specific setup here
GOTO END

:XMS
:: XMS-specific setup here
GOTO END

:Windows
:: Windows-specific setup here
GOTO END

:END


This kind of menu would typically be used to control the configuration of

• the memory manager: HIMEM.SYS only (for games which wouldn’t work with a V86 memory manager), EMM386.EXE with or without EMS (without EMS, you’d get 64K more UMBs)
• the amount of resources assigned to FILES, BUFFERS etc. (you’d need more for a multi-tasking environment; this could be what your friend’s “Windows” configuration changed)
• various drivers (e.g. the CD-ROM driver, sound card setup with a PCI card, network drivers...)
• SHARE.EXE when running Windows

For older versions of MS-DOS, there were separate boot configuration tools available, including some which allowed for early-boot selection of CONFIG.SYS directives. DR DOS 5 and later implemented its own menu system, in a more manual fashion.

• Although your answer is way more explicit and readable, it still seams like a duplicate of what @tommylee2k wrote. Wouldn't it be nice if the two could be merged? (Or maybe incooperatining his parts where he included the menu line text parameter in an over all better commented confic.sys) Just wondering. – Raffzahn Jun 21 '18 at 10:18

It was an option in (afaik) MS-Dos 6.0 and later, where you were able to define different sections in config.sys

[MENU]
REM syntax: Name, Descritopn

[COMMON]
DEVICE=C:\DOS\HIMEM.SYS
DOS=HIGH,UMB

[DOSCD]
REM this is only loaded when "DOSCD" is selected
DEVICE=C:\DOS\EMM386.EXE NOEMS
DEVICE=C:\DOS\CDROMDRV.SYS /D:CD1

[DOS]
REM this is only loaded when "DOS" is selected
DEVICE=C:\DOS\EMM386.EXE NOEMS

[WIN]
REM and this for "WIN", items can even be empty


the configuration chosen was also promoted to autoexec.bat with the environment-Variable 'CONFIG':

...

REM Uses the identifier from CONFIG.SYS to goto a label
GOTO %CONFIG%

:DOSCD
LH C:\DOS\MSCDEX.EXE /D:CD1
GOTO EXIT

REM no mscdex needed
:DOS
GOTO EXIT

REM right into Windows
:WIN
win :

:EXIT


Yes MS-DOS menu is in autoexec.bat and config.sys. These two files are use by MS-DOS startup. The config.sys is for loading drivers and autoexec.bat is used to set prompt, variables, TSRs and run desired apps.

So up to w9x it can be also used to select OS as the Windows was just an executable on top of MS-DOS. So you add menu entry in config.sys with drivers needed (windows has its own drivers but IIRC it needed himem.sys before running win.exe)

Here are mine:

Autoexec.bat

@echo off
PROMPT $P$G
PATH e:\rescue;e:\rescue\dos98;e:\rescue\vcnew;e:\rescue\pack;e:\rescue\views
e:
cd rescue
SET TEMP=e:\rescue\temp
SET BLASTER=A220 I5 D1 H5 P330 E620 T6
SET SOUND=e:\rescue\SB16
SET MIDI=SYNTH:1 MAP:E MODE:0
e:\rescue\SB16\DIAGNOSE /S
e:\rescue\SB16\AWEUTIL /S
e:\rescue\SB16\MIXERSET /P /Q

goto %config%
:a
:b
:c
:d
:e

lh gmouse
LH vc


Config.sys

;devicehigh=e:\rescue\dos98\interlnk.exe
shell e:\rescue\dos98\command.com e:\rescue\dos98 /P
lastdrive=M
files=50
buffers=8
stacks=0,0
DOS=HIGH,UMB

[a]
device=e:\rescue\dos98\qemm386.sys RAM BE:N
[b]
device=e:\rescue\dos98\himem.sys
devicehigh=e:\rescue\dos98\emm386.exe rammax
[c]
device=e:\rescue\dos98\himem.sys
devicehigh=e:\rescue\dos98\emm386.exe noems
[d]
device=e:\rescue\dos98\himem.sys
[e]
device=e:\rescue\dos98\himem.sys
devicehigh=e:\rescue\dos98\ramdrive.sys 32767 /e


taken from: SO/SE: Run Turbo C++ in Freedos where you can find also tips on how to run MS-DOS on newer machines. Beware that from W95 the MS-DOS is not fully compatible with the old MS-DOS 6.22 so some games and apps will not work properly or at all. The other answers here cover the MS-DOS menu well enough so I see no point in describing the obvious mechanism...

From NT,W2K and XP there was no more MS-DOS just console so for those you need to use boot.ini like this:

[boot loader]
timeout=30
default=multi(0)disk(0)rdisk(0)partition(1)\WINDOWS
[operating systems]
multi(0)disk(0)rdisk(0)partition(1)\WINDOWS="Microsoft Windows XP Professional" /noexecute=optin /fastdetect /usepmtimer


Each line in the [operating systems] represents one OS to boot from. You also need separate partition per OS so have MS-DOS on separate partition (or floppy) there are also utilities like Lilo boot that can handle multi OS. IIRC the boot.ini could be edited from msconfig.exe.

The above example is from XP. The Vista,W7 and latter do not use boot.ini anymore instead they have some kind of boot app (like Lilo boot). The menu is usually created during Windows installation (as the installer detects OS in the PC) but nowadays HW has usually boot menu directly in BIOS of the MB.

In the past I usually got MS-DOS 6.22 + W9X + W2K on single machine as I got plenty of apps running only in those specific OS that I was not able to part with...

PS.

At one time I even got 5.25" DD Floppy with MS-DOS 6.22 system files (and all the rest was on HDD hence the weird e:\rescue\ path as the floppy did not have enough space. That solution was great as even command.com was on the HDD so no speed problems due to booting from floppy. That is what

shell e:\rescue\dos98\command.com e:\rescue\dos98 /P


does in the config.sys of mine ... And the E: was just logical drive instead of separate partition ...

In case you are going for MS-DOS you should see:

on how to deal with runtime error 200 and for list of apps you should have in your OS (with link to archive where many of them are still available).

• What issues did you run into with DOS 7? I used it for a long time with a huge variety of games and don’t remember running into insurmountable problems... – Stephen Kitt Jun 22 '18 at 8:18
• IIRC custom HW programs like scanners and robotics did not run properly in DOS7. There where also games that did not run but can not remember which I think most of them where 3Dfx related. IIRC They either crashed/restarted or freeze in black screen. It was too long ago ... and it might be just an issue that could be remedied by some SET or utility we did not know of then... but as in MS-DOS 6.22 was all OK we used that instead... – Spektre Jun 22 '18 at 9:31

I set up my Windows 95 machine to boot to DOS or Windows 3.1 or Windows 95. I believe the machine initially booted via DOS, calling my autoexec.bat, which ran a user menu. Choosing "DOS" exited to the DOS prompt. Choosing one of the Windows installations would rename one of the directories to "C:\windows", the other to something outside of the \$PATH, and then the autoexec.bat file would call "win". I can't recall how that "win" call would start up 95 though; it's been 20 years.