VOGONS


Command Issue

Topic actions

First post, by Hyugao

User metadata
Rank Newbie
Rank
Newbie

Hello! First of all, if this happens to be the wrong forum section, I'd like to apologize. About my problem: Usually I get along with dosbox fine, but this time, I'm overseeing something or am just too dumb to solve it myself.

What I want to do is make a batch file that starts dosbox (without knowing the path of it) while mounting the dictionary the batch file was executed from as C: and then start an application in it (happens to be a batch file too).

I've been studying manuals and google for ages, and this is what would make sense for me, quoting from the Usage page: "Example
dosbox c:\atlantis\atlantis.exe -c "MOUNT D C:\SAVES"
This would mount c:\atlantis as c:\ and run atlantis.exe. Before it does that, it would first mount C:\SAVES as the D drive."

So far so good, I did the same thing (without the -c actually) but no matter what paths, parameters or antyhing I do, it says the command "dosbox" is either spelled wrong or doesn't exist. Shouldn't this work fine or am I overlooking something?

In case somebody provides me with another solution, what I'm trying to do is create a dummy guide and distribute a really old application with it. The guide includes installing dosbox, downloading an extractor, then download the game (which includes the batch file), and then, by starting only the batch file, the game should run. The aim is to make sure even people with no computer experience can follow the guide and succeed, that's why I stay away from the usual stuff like mounting everything manually and such.

Thanks for your help and sorry if this is a newbie-like problem.

Reply 1 of 8, by VileR

User metadata
Rank l33t
Rank
l33t

The only way to start DOSBox without knowing where it is is to add its location to the PATH environment variable (permanently from the control panel, not from the command prompt).
But that just complicates matters (and requires you to know where DOSBox is at least once), so you might want to keep the batch file in the same directory as dosbox and just create a shortcut to it elsewhere.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 2 of 8, by collector

User metadata
Rank l33t
Rank
l33t

You could just use relative paths if this is to be something portable. In other words, if you have copy of DOSBox in a subdirectory of where the batch file is. This folder could be moved anywhere (i.e. something like a thumb drive) and still work as long as paths did not change below the parent folder.

The Sierra Help Pages -- New Sierra Game Installers -- Sierra Game Patches -- New Non-Sierra Game Installers

Reply 3 of 8, by Hyugao

User metadata
Rank Newbie
Rank
Newbie

Thanks guys, I'll have it in the same path, that should still do the job. Thanks for the quick and helpful answers.

Reply 4 of 8, by Hyugao

User metadata
Rank Newbie
Rank
Newbie

I'm sorry to bump this again, but apparently I seem to be doing something wrong. My batch file contains "DOSBOX.exe %CD% -c hge.bat", which I thought would do what I need, but the problem is that it executes hge.bat before having mounted the path as C:, resulting in DosBox wanting to open it in Z:\, thus not working.

I'm now trying DOSBOX.exe -c "MOUNT C: %CD%" -c C:\ -c hge.bat, which seems to work, is there any downside about this?

Edit: I now found out that it will not work if the path in %CD% contains any spaces. Any idea how to fix this?

Reply 5 of 8, by VileR

User metadata
Rank l33t
Rank
l33t
Hyugao wrote:

Edit: I now found out that it will not work if the path in %CD% contains any spaces. Any idea how to fix this?

Wrap %CD% with single quotes (-c "MOUNT C: '%CD%'") - DOSBox seems to translate this to double quotes when parsing the command, this will take care of any spaces in the path.

[ WEB ] - [ BLOG ] - [ TUBE ] - [ CODE ]

Reply 6 of 8, by collector

User metadata
Rank l33t
Rank
l33t

You could also do all of your mounting in the autoexec section of a custom conf file, then call DOSBox with the "-conf" parameter.

Reply 7 of 8, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

%CD% ? I can't recall ever seeing that before.

Generally it is much easier to use a single period, as in "mount c ." . Note that the colon after "c" is not necessary.

I agree that conf files would seem more intuitive.

Reply 8 of 8, by Hyugao

User metadata
Rank Newbie
Rank
Newbie

Thanks again, you've been really great help!