VOGONS

Common searches


Batch Files

Topic actions

First post, by JPV511

User metadata
Rank Newbie
Rank
Newbie

How do I create batch files to instantly load games? So far, I know only to edit the dosbox config file, but it's only for a single game. How do I create batch files for other games?

Reply 1 of 4, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Make a text file with all the commands on different lines and save it as gamename.bat.
For example to run thegame, thegame.bat

cd thegame
Thegame.exe

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper

Reply 2 of 4, by SKARDAVNELNATE

User metadata
Rank Oldbie
Rank
Oldbie

What do you want the batch file to do? If it just to launch a game the autoexec section of the DOSBox.conf file should be enough.

Let's say your autoexec reads

MOUNT C "C:\DOS" -t dir -freesize 200

and thegame is located in C:\DOS.

If thegame requires a CD which you have imaged, you can use the batch to mount it.

Z:
MOUNT -u D
IMGMOUNT D "C:\DOS\thegame\thegame.iso" -t iso
C:

If thegame defaults to 3000 cycles but you want it to run faster you can add something like this to the batch file

CONFIG -set "cpu cycles=20000"

If thegame is part of a series you could make a menu.

@ECHO OFF
:START
CLS
ECHO 1) thegame 1
ECHO 2) thegame 2: the only victory is to deny it combat
ECHO 3) thegame 3: revenge of the sore losers
ECHO 4) thegame 4: the last cliffhanger
ECHO.
CHOICE /C:12345
ECHO.
IF ERRORLEVEL 5 GOTO END
IF ERRORLEVEL 4 GOTO PROG4
IF ERRORLEVEL 3 GOTO PROG3
IF ERRORLEVEL 2 GOTO PROG2
IF ERRORLEVEL 1 GOTO PROG1

:PROG1
ECHO.
ECHO Loading Program 1
CD PROG1
PROG1.EXE
CD ..
pause
GOTO START

:PROG2
ECHO.
ECHO Loading Program 2
CD PROG2
PROG2.EXE
CD ..
pause
GOTO START

:PROG3
ECHO.
ECHO Loading Program 3
CD PROG3
PROG3.EXE
CD ..
pause
GOTO START

:PROG4
ECHO.
ECHO Loading Program 4
CD PROG4
PROG4.EXE
CD ..
pause
GOTO START

:END
ECHO.
ECHO Exiting Menu
pause
:EXIT

Reply 4 of 4, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Make a batchfile with the gamename or exe name and do the cd command in there.
You *could* enter all directories in the Path setting but that is limited to something and thus will not work for everything and many games would be screwed up anyways since they expect files in their directory...

Windows 3.1x guide for DOSBox
60 seconds guide to DOSBox
DOSBox SVN snapshot for macOS (10.4-11.x ppc/intel 32/64bit) notarized for gatekeeper