DosBox Users: Batch Menu/Launcher

Post up issues you are encountering with MechWarrior 2 here, this includes Netmech.
Forum rules
Search before asking!
No Swearing!
Post Reply
User avatar
LordNova2
House Steiner Sergeant
House Steiner Sergeant
Posts: 146
Joined: Sun Mar 08, 2009 5:33 pm
Location: Pocahontas, IA USA
Contact:

DosBox Users: Batch Menu/Launcher

Post by LordNova2 »

I have created a nice little BATCH file for use with DosBox and MW2, it allows you to load/switch game discs and load up the games. So all you will have to do is copy this code over to notepad and save it as a *.BAT file (like MENU.BAT). You will also want to look into setting up DosBox to by standard have mounted the virtual HDD, and pre-set to automatically load up the BATCH file on startup.

Code: Select all

@ECHO OFF
:START
CLS
ECHO                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO                  º       MECHWARRIOR2  GAME  LAUNCHER        º
ECHO                  ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
ECHO                  º ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ º
ECHO                  º ³ 1  MechWarrior2: 3st Century Combat   ³ º
ECHO                  º ³ 2   NetMech                           ³ º
ECHO                  º ³   A   Mount MW2:31CC CD ROM           ³ º
ECHO                  º ³ 3  MechWarrior2: Ghost Bear's Lagacy  ³ º
ECHO                  º ³   B   Mount MW3:GBL CD ROM            ³ º
ECHO                  º ³ 4  MechWarrior2: Mercenaries          ³ º
ECHO                  º ³ 5   MercNet                           ³ º
ECHO                  º ³   C   Mount MW2:Mercs CD ROM          ³ º
ECHO                  º ³                                       ³ º
ECHO                  º ³ 6  Command Prompt                     ³ º
ECHO                  º ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
ECHO                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
ECHO ________________________________________________________________________________
ECHO.
CHOICE /c:12A3B45C6 /n CHOOSE THE PLACE OF COMBAT:
IF ERRORLEVEL ==9 GOTO DOS
IF ERRORLEVEL ==8 GOTO MERCSDISC
IF ERRORLEVEL ==7 GOTO MERCNET
IF ERRORLEVEL ==6 GOTO MW2MERCS
IF ERRORLEVEL ==5 GOTO GBLDISC1
IF ERRORLEVEL ==4 GOTO MW2GBL
IF ERRORLEVEL ==3 GOTO MW2DISC
IF ERRORLEVEL ==2 GOTO NETMECH
IF ERRORLEVEL ==1 GOTO MW231CC
:MW231CC
ECHO.
ECHO Launcing MechWarrior2: 3st Century Combat!
CD\
CD MECH2
MECH2.EXE
GOTO START
:MW2DISC
ECHO.
MOUNT -u D
IMGMOUNT D C:\DOSBOX\CDRS\MECH2.BIN -t iso
PAUSE
GOTO START
:NETMECH
ECHO.
ECHO Launching NetMech!
CD\
CD NETMECH
NETMECH.EXE
GOTO START
:MW2GBL
ECHO.
ECHO Launching MechWarrior2: Ghost Bear's Legacy!
CD\
CD GBL
GBL.EXE
GOTO START
:GBLDISC
ECHO.
MOUNT -u D
IMGMOUNT D C:\DOSBOX\CDRS\GBL.BIN -t iso
PAUSE
GOTO START
:MW2MERCS
ECHO.
ECHO Launching MechWarrior2: Mercenaries!
CD\
CD MERCS
MERCS.EXE
GOTO START
:MERCSDISC
ECHO.
MOUNT -u D
IMGMOUNT D C:\DOSBOX\CDRS\MERCS.BIN -t iso
PAUSE
GOTO START
:MERCNET
ECHO.
ECHO Launching MercNet!
CD\
CD MERCS
MERCNET.EXE
GOTO START
:DOS
ECHO.
CHOICE /c:YN Embrace cowardice?
ECHO.
IF ERRORLEVEL ==2 GOTO START
IF ERRORLEVEL ==1 GOTO END
:END
PAUSE
CLS

Note: I had encountered problems when I tried to directly specify the game’s executable (eg C:\MECH2.MECH2.EXE) in the BATCH file and straight in DosBox. However I found that if I advanced through the directories line by line, like I normally do, and then specified the executable it works fine, so that is why you see me calling up:
“CD\
CD MECH2
MECH2.EXE”
instead of:
“CD\
C:\MECH2\MECH2.EXE”


As you all know the drill, you may not all have the same filenames and directories as I do, so you will have to go through the script and make the correct changes, removals, and corrections.
As I know some of us (including myself) might be a bit rusty with BATCH scripting and DOS commands, not to mention all the new stuff DosBox adds or are completely new to it, you will not only want to remove and edit the menu where it echoes the list, but you have to go into the choice and errorlevels and modify them as well, and might will want to look into removing any unused code with these modifications.
For example if you wish to remove the Ghost Bear’s Legacy game from the menu, you will want to first start removing it from the list so it reads something like:

Code: Select all

ECHO                  ÉÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍ»
ECHO                  º       MECHWARRIOR2  GAME  LAUNCHER        º
ECHO                  ÇÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄĶ
ECHO                  º ÚÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄ¿ º
ECHO                  º ³ 1  MechWarrior2: 3st Century Combat   ³ º
ECHO                  º ³ 2   NetMech                           ³ º
ECHO                  º ³   A   Mount MW2:31CC CD ROM           ³ º
ECHO                  º ³ 3  MechWarrior2: Mercenaries          ³ º
ECHO                  º ³ 4   MercNet                           ³ º
ECHO                  º ³   B   Mount MW2:Mercs CD ROM          ³ º
ECHO                  º ³                                       ³ º
ECHO                  º ³ 5  Command Prompt                     ³ º
ECHO                  º ÀÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÄÙ º
ECHO                  ÈÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍÍͼ
And you will need to modify the choices and error-levels too. FYI: The error-levels will point to the label of the section of code that is used.

Code: Select all

CHOICE /c:12A34B5 /n CHOOSE THE PLACE OF COMBAT:
IF ERRORLEVEL ==7 GOTO DOS
IF ERRORLEVEL ==6 GOTO MERCSDISC
IF ERRORLEVEL ==5 GOTO MERCNET
IF ERRORLEVEL ==4 GOTO MW2MERCS
IF ERRORLEVEL ==3 GOTO MW2DISC
IF ERRORLEVEL ==2 GOTO NETMECH
IF ERRORLEVEL ==1 GOTO MW231CC
And you will want to remove the MW2GBL and GBLDISC portions of the code as well to get rid of the unused code. Those portions of the code look like this:

Code: Select all

:MW2GBL
ECHO.
ECHO Launching MechWarrior2: Ghost Bear's Legacy!
CD\
CD GBL
GBL.EXE
GOTO START
and

Code: Select all

:GBLDISC
ECHO.
MOUNT -u D
IMGMOUNT D C:\DOSBOX\CDRS\GBL.BIN -t iso
PAUSE
GOTO START


And remember you can have allot of fun with this, you can even heavily modify this script to be an archive of easy-to-navigate menus for other games/applications and functions you use with DosBox.
Your best bet is to google “Batch File” and what not for trying to learn/remember the coding, and not every batch code will work with DosBox, as DoxBox is based off the older versions of DOS that was used to play these games with back in the 90s, and is not a complete package of the MS DOS we remember (does not have all the fancy commands/apps like EDIT FORMAT ect.) However if you look around you can find copies of DOS with all the bells and whistles that you can download and use with DosBox.
Image
Post Reply