VOGONS


First post, by bardus

User metadata
Rank Newbie
Rank
Newbie

I'm trying to run Dosbox from a script, but it doesn't execute the autoexec portion of the Dosbox.conf file when I do so.

The reason I am trying to do this is because I have a series of programs I need to run. One of these works only on a machine with the .NET framework (written in C#), and another is an old DOS conversion program (Intel Object to Hex if you were wondering) that seems to work only on older machines (it hangs up while piping STDOUT to a file on any machine made in the last few years).

The first program uses the .NET framework. I process some XML and convert it to a C header file, and this program can't run under Dosbox. The script I wrote runs this program ifirst n my regular operating system, and then calls up Dosbox. I've added code to the Dosbox.conf file to do the rest of the processing with the DOS conversion program, and then exit. It works fine when I run Dosbox manually (doubleclick it), but when I run it from the script the autoexec code never gets run.

Anybody have any ideas? I think it has something to do with having two batch files going at once, but I can't think of anything to do about it. I'm about to start looking into XML libraries for C and re-writing my XML converter, but I'd rather not if I can avoid it.

Thanks in advance...

Reply 2 of 5, by MiniMax

User metadata
Rank Moderator
Rank
Moderator

I often use something like this (a .CMD file) to start DOSBox. The dosbox.conf file is kept in the same directory as the script:

@   echo off

if not defined dosbox (
set dosbox=%ProgramFiles%\DOSBox-0.72\dosbox.exe
)

if not exist "capture" mkdir "capture"
if not exist "C-drive" mkdir "C-drive"

start "DOSBox" "%dosbox%" -noconsole %*

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 3 of 5, by bardus

User metadata
Rank Newbie
Rank
Newbie

I moved the config file to the directory the script runs from and that fixed it. Thanks.

Anyone know the syntax for directing Dosbox to a non-local config file? I tried including a full path to the config as the first argument after calling Dosbox, but that didn't work.

I also noticed that if I have Windows Explorer open to the same directory that Dosbox is overwriting files in it will crash Dosbox. Looks like maybe there is some sort of permission fight going on.

Reply 4 of 5, by ErikGG

User metadata
Rank Member
Rank
Member

In frontends we use the -conf "Path to conf file" commandline parameter to start DOSBox, so to start DOSBox in a script I do something like :

"C:\DOSBox\DOSBox.exe" -conf "C:\Path to Conf\MyConf.conf"
Including the quots.

This starts dosbox with the given autoexec in the conf file.

Erik.

Read the new FAQ.doc

Reply 5 of 5, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

This is in the README btw.