VOGONS


Batch file problem

Topic actions

First post, by kate_arsher

User metadata
Rank Newbie
Rank
Newbie

Hello!!

First, excuse me for my poor English, but i'm French.

Sorry if somewone have already ask this question :
I've a problem with batch file in Dosbos. In the dosbox.conf, in the autoexec section, i've these lines :

mount y c:\dosbox
y:
autoexec.bat

in the autoexec.bat, i've this :

mount C C:\dosbox
mount A A:\ -t floppy
y:
cd\xkeyb\
keyb BE.key
mount x C:\dosbox\syndicate\
x:
SYND.BAT
exit

Dosbox mount the two drives (C and A), run keyb and... stop.
I've try a batch file like this :

c:
cd\synd
synd
exit

When i quit Syndicate, Dosbox don't execute the last line (exit).

What is the problem?

Thanks in advance!

Last edited by kate_arsher on 2008-02-07, 15:50. Edited 1 time in total.

www.kate-arsher.be

Reply 1 of 11, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Try
CALL SYND.BAT
instead of just SYND.BAT

Reply 2 of 11, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

ouch, your autoexec is messed up.

Do this (and don't load the autoexec.bat you're laoding) in the autoexec section of dosbox.conf:
mount C C:\dosbox
mount A A:\ -t floppy
c:\xkeyb\keyb be.key
c:\syndicate\synd.bat
exit

(ok, the only problem I see is that syndicate is too long a word, shorten the directory by a character and change the above autoexec accordingly)
You really don't have to have such a complicated batch system as you have (it really serves no purpose).
Also your language might be covered by the Dosbox internal keyboard command, so probably no use to load the extra one you have.

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 3 of 11, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

c:\syndicate\synd.bat
exit

Again, this will only work if you use CALL SYND.BAT

Reply 4 of 11, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

Again, this will only work if you use CALL SYND.BAT

Can you tell me why? Of course I belive you, I'd just like to get educated why this works and the other way doesn't 😀

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 5 of 11, by kate_arsher

User metadata
Rank Newbie
Rank
Newbie

It's work gereat with call, thanks.

I've modified the autoexec.bat like this :

mount C C:\dosbox 
mount A A:\ -t floppy
y:
cd\xkeyb\
call keyb BE.key
mount x C:\dosbox\syndicate\
x:
call SYND.BAT
exit

and it's working (it's a part of a program i made for my job, i test it with games... )

Thanks a lot.

ps : with call, dosbos wait for the end of the program before continue the execution of the bat file (-> i think it's that).

www.kate-arsher.be

Reply 6 of 11, by Qbix

User metadata
Rank DOSBox Author
Rank
DOSBox Author

there can only be one batchfile active at one time. (without call)
so if you start one without call then it can not return to the original batchfile.
so all lines below the synd.bat will be skipped

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

Reply 8 of 11, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

It's nothing dosbox specific btw., just some nice msdos oddity.
Think i never knew about this back in the dos days...

Reply 9 of 11, by Dominus

User metadata
Rank DOSBox Moderator
Rank
DOSBox Moderator

It's nothing dosbox specific btw., just some nice msdos oddity.

Yeah, I figured. I saw this back in the days in some batchfiles but never looked into why the batches were called...

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 10 of 11, by kate_arsher

User metadata
Rank Newbie
Rank
Newbie
Qbix wrote:

there can only be one batchfile active at one time. (without call)
so if you start one without call then it can not return to the original batchfile.
so all lines below the synd.bat will be skipped

If i've good memories, with ms-dos you can call different batch file without using the call function.

www.kate-arsher.be

Reply 11 of 11, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

Yes but you need to CALL them.