VOGONS

Common searches


First post, by rgriff

User metadata
Rank Newbie
Rank
Newbie

I'm having difficulty having dosbox close after running a program. I use the exit flag in my batch, but termination just goes to the dosbox c:> prompt. Here is the line in my batch file:

dosbox e:\games2\innocent\iuc.bat -exit -c "set sound=drivers"

Any ideas would be appreciated. The game is Innocent Until Caught, BTW.

Reply 2 of 13, by rgriff

User metadata
Rank Newbie
Rank
Newbie

Thanks a lot...it did the trick! The same will not work for Jones in the Fast Lane, however. After quitting the program, dosbox remains with the cd prompt (in my case y:\>). Why doesn't the -exit flag work in the command line for dosbox?? Thanks for any ideas.

Reply 3 of 13, by Markus

User metadata

Well, I can't tell what's going wrong for you, but for me "-exit" works.
As far as I know, dosbox is picky about the order of parameters, so you can try to rearrange them.
But the easiest way is to start your game through a batch file like this:
"Jones in the fast lane.exe (or whatever)
exit"
Or start your game with it's own dosbox.conf and edit the section [autoexec] like before.

Reply 4 of 13, by rgriff

User metadata
Rank Newbie
Rank
Newbie

Yes, I use a batch file with the dosbox command line to start the batch file created by the game for starting the game which accesses the resource.cfg file (containing the sound and video information). I've tried the -exit flag in the first batch file in the dosbox command line -- no good. I've also tried adding the line "exit" (without quotes) to the 2nd batch file created by the games' installation, which also has no effect. When I exit the game, I am returned to my cdrom prompt y:> where I must manually type exit to get out of dosbox. Oh well...at least the voices are working in the game. Thanks for your help.

Reply 7 of 13, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

the problem is that you want to run a .bat file.

here's why:
-exit adds exit as last command to the internal autoexec.bat

but running a bat destroys autoexec.bat (e.g. it doesn't return.)
This is design of DOSBox and of DOS

Try for example
a.bat:
echo hi
b.bat
echo return from b

b.bat:
echo inside b

You'll notice that "return from b" is missing. (e.g one batfile kills the other)

The right way of doing it is call .bat file instead of running it.
I'll probably modify dosbox it's commandline parsingutility to deal with this.

Try this as a workaround
dosbox -c "mount c e:\games2\innocent" -c "set sound=drivers" -c "c:" -c "call iuc.bat" -c "exit"

edit: FIXED

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

Reply 8 of 13, by Markus

User metadata

Yes, Qbix, you're right with batch-file-nesting, but I think, that's only half of the problem: if b.bat ends with "exit" it should terminate dosbox (at least it does so with any secondary real command.com.)

I think the problem here is, that rgriff trys to start dosbox inside another batch-file and that this batch - for whatever reason (e.g. started through command /k) - refuses to close.

Reply 9 of 13, by rgriff

User metadata
Rank Newbie
Rank
Newbie

Hi and thanks for the help.

Neither method worked for me. I created a shortcut to DOSBox.exe and used the same command line as in my batch file which executed the game, but likewise ,even with the -exit flag, I was dumped to my cdrom prompt in DOSBox and not to Windows (I figure it is DOSBox and not command.com because my other partitions d:\, e:\, etc. 'do not exist' when I try to access them because they have not been mounted in DOSBox). The workaround suggested by Qbix would not start the game and just dropped back to Windows. The 'exit' line added to the 'Innocent Until Caught' batch file worked as it should, but the 'Jones in the Fast Lane' batch file seems to ignore it. Here is the Jones.bat file:

Y:
jones f:\games1\sierra\jones\resource.cfg
exit

and here is the IUC.bat file:

@rem INNOCENT until caught
@rem (c)1993 Divide By Zero
@
@echo off
if exist innocent.ini goto installed
set_iuc
:installed
innocent %1 %2 %3 %4 %5 %6 %7 %8 %9
exit

If you can think of any other way to return to Windows after exiting the game without having to type 'exit' at the prompt, let me know. It's not a big deal...I'm just glad to have the game working like it should! Thanks.

Reply 10 of 13, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

> Y:
> jones f:\games1\sierra\jones\resource.cfg
> exit

And what is Y:jones ? An .EXE, .COM, or a .BAT ?

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32

Reply 12 of 13, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

> jones is a .bat file ...
That's your problem. When the DOSBox command interpreter sees the 'jones f:\games1\sierra\jones\resource.cfg' it loads and run the jones.bat and completely forgets about the current 'Jones.bat' file - and the 'exit' command still waiting in the pipeline.

This is exactly what Qbix wrote earlier:

You'll notice that "return from b" is missing. (e.g one batfile kills the other)

The right way of doing it is call .bat file instead of running it.

Change your Jones.bat to read:

Y:
call jones.bat f:\games1\sierra\jones\resource.cfg
exit

and I think it will work.

DOSBox 60 seconds guide | How to ask questions
_________________
Lenovo M58p | Core 2 Quad Q8400 @ 2.66 GHz | Radeon R7 240 | LG HL-DT-ST DVDRAM GH40N | Fedora 32