VOGONS


Making a batch file

Topic actions

First post, by JubJub

User metadata
Rank Newbie
Rank
Newbie

I have XP and I want to make a batch file that will automaticall type in all the "mount c c:\" and such commands. My problem is this, i can't figure out how to make the batch file type the commands into dosbox rather than the command prompt window. I have Dosbox-0.61 as well as dosbox-0.62 so go from there.

Reply 1 of 10, by robertmo

User metadata
Rank l33t++
Rank
l33t++

just edit dosbox.conf and type all the mounting under [autoexec]

Reply 2 of 10, by JubJub

User metadata
Rank Newbie
Rank
Newbie

All right, thanks. I got that working and I have another question: How do you make DOSBOX execute a command on exit from a program?

What I want to happen is, when I exit the program that I'm running in DOSBOX, then DOSBOX automatically changes directories. How can I do that?

Reply 3 of 10, by mirekluza

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

You can run normal BAT files in DOSBOX (as in normal DOS). The BAT file can mount a disk/start program/change the directory etc. As in normal DOS.

Mirek

Reply 4 of 10, by JubJub

User metadata
Rank Newbie
Rank
Newbie

Yeah, But I want DOSBOX to change the Directory AFTER EXITING the program. Will that still do it?

Reply 5 of 10, by icemann

User metadata
Rank Member
Rank
Member

Thats more of a matter of dos batch file programming than what to do in dosbox.

Two stones, two crosses, the rest is just icing. - 7th Guest

Reply 6 of 10, by JubJub

User metadata
Rank Newbie
Rank
Newbie

Yes well the title of the thread IS

Making a batch file

Reply 7 of 10, by Guest

User metadata

You would have to make a batch file for every single progam you want to run, or if you're really feeling advanced, there is a way to pass a batch file variables, I sure don't remember how though... as for doing it per program, i'd do something like this for say, Quest for glory 1

scidhuv
cd\dosbox\games\crap
cls

that will run scidhuv.exe, the games executable, then once that executable closes it will change to the dosbox\games\crap directory, then finally it will clear the screen.

Reply 8 of 10, by JubJub

User metadata
Rank Newbie
Rank
Newbie

I have a bacth file for my one game

cd\arena
arena.bat
cd\

Now, if i just type in "cd\" then it returns me to the "c:\" prompt. But If I run the batch file, it stays in the ARENA folder.

I have another batch for another game

cd\dagger set dos4gvm=@dagger.vmc fall.exe z.cfg cd\ […]
Show full quote

cd\dagger
set dos4gvm=@dagger.vmc
fall.exe z.cfg
cd\

And it works fine. It does what I want it to, it returns me to the dos prompt upon exit of the game.

Any help?

Reply 9 of 10, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

the first one replace the line

arena.bat with

call arena.bat

Water flows down the stream
How to ask questions the smart way!

Reply 10 of 10, by JubJub

User metadata
Rank Newbie
Rank
Newbie

Perfect!
Thanks!