Hello folks! I am trying to edit the config autoexec to automount te first physical Optical drive as drive D on any host computer I run it. Is it possible to do that? I am about to make an auto installer for a game, but no CD image will be included of course so dosbox could automount the first CD drive. Thank you.
Just add this line to the "Autoexec" section of DOSBox.conf:
Z:\>MOUNT D D:\ -t cdrom
However, I advise you not to do it. Unless you have a disc inserted, DOSBox will return an error message everytime you run it. And in many PCs D: is mapped to a second hard drive, making the instruction useless.
Hm I was wondering how this could be done with the "-usecd" switch the readme sas that the number after mount -usecd is the number we get after mount -cd, but when I type in mount -usecd 0 it doeasn't work, could someone give an example how to use the -usecd switch to do this?
This would be so nice if it could its job without hitting a button
you mean without any keystrokes or supplementary clicks?
well, frontends are for that..
or my setup I already mentioned: its scope being precisely to minimize "interactivity"
or sticking to the example I just gave building on mount -cd
even that could be optimized further if necessary
the moment dosbox needs to be manually closed, after mount -cd > cdrom.txt
can be ironed out in the script by killing the task (dosbox.exe) right on so it goes ahead without a click
the drive letter picking out might also be made a little more user-friendly
if you look up dos_programs.cpp in dosbox source you can spot this:
1 // Show list of cdroms 2 if (cmd->FindExist("-cd",false)) { 3 int num = SDL_CDNumDrives(); 4 WriteOut(MSG_Get("PROGRAM_MOUNT_CDROMS_FOUND"),num); 5 for (int i=0; i<num; i++) { 6 WriteOut("%2d. %s\n",i,SDL_CDName(i)); 7 }; 8 return; 9 }
where mount -cd gets implemented
if you can edit that so it boils down to something like
1 if (cmd->FindExist("-cd",false)) { 2 WriteOut("Cdrom drive letter is %s\n",SDL_CDName(0)); 3 }; 4 return; 5 }
and then in the script the lines with find and following become
find /i "letter" cdrom.txt
echo.
set /p drive_letter=Please, type cdrom letter (d, e, f...) =
then its output will look something like
---------- CDROM.TXT
Cdrom drive letter is D:\
Please, type cdrom letter (d, e, f...) =
you still have to state the letter, that's true, but afterwards it's all going smoothly, I guess
after the final -c "mount c c:\dosbox" -c c:
commands I wrote, for instance for Tomb Raider you could concatenate -c "cd tombraid" -c dir
in a row, or whatever you deem fit
what about it?
We often forgive those who bore us, but we cannot forgive those whom we bore. (La Rochefoucauld)
why no -c exit in the dosbox lnes ?
anyway this auto mounting the first cdrom seems a bit like I want to distribute the game + dosbox to others as easy as possible.
well, actually I tried to use -c exit but for some reason it didn't work
neither in dosbox.exe [-c exit] -c "mount c c:\dosbox" -c c: -c "mount -cd > cdrom.txt"
nor in dosbox.exe [-c exit] -c "mount d %drive_letter%:\ -t cdrom" -c "mount c c:\dosbox" -c c:
no avail
the way I can see it, as per readme definitions:
dosbox [name] [-exit]
-exit
DOSBox will close itself when the DOS application "name" ends.
is because no app "name" had been specified there
otherwise I have no clue why
so I just had to taskkill it (with /f and /t flags) or close manually.
We often forgive those who bore us, but we cannot forgive those whom we bore. (La Rochefoucauld)
you mean, as in: dosbox [name]?
no way, afaik it's just the app and/or dir that dosbox's working on
see the readme:
dosbox [name]
name
If "name" is a directory it will mount that as the C: drive.
If "name" is an executable […] Show full quote
dosbox [name]
name
If "name" is a directory it will mount that as the C: drive.
If "name" is an executable it will mount the directory of "name"
as the C: drive and execute "name".
Qbix, I found it at last
both -c exit and -exit fail on me, but the right thing seems to be going -c "exit"
at end of line and so it does its thing, packs it in and I can drop taskkill now:
another one:
curiously though, right thereafter, down the lines of that little test script:
1cd c:\dosbox 2:d 3findstr "D:" cdrom.txt 4if errorlevel 1 goto e 5set drive_letter=d 6goto found 7:e 8findstr /i "e:" cdrom.txt 9if errorlevel 1 goto f 10set drive_letter=e 11goto found
unless I insert a pause right after cd c:\dosbox and before findstr,
findstr won't recognize cdrom.txt as if it was running ahead of its shadow so to speak 😵
I tested and if I place a couple of dir's around pause this way
Instead of going through all that couldn't you just write this
yep, but only in what they call pseudo-code
irl I'm afraid things don't get that simple
for instance, you'd be supposed to handle the host of drive not ready etc. warnings that would follow through
not to mention that you'd still need to get the correct actual drive ID that goes through to go ahead wouldn't you...
all this no doubt could be, and usually gets, done manually,
but the OP's point iirc was to make mount work out automagically.
We often forgive those who bore us, but we cannot forgive those whom we bore. (La Rochefoucauld)
Like I said I am learning the system. I will explain what I have done so far. I have taken all the contents of dosbox and under a killing moon and combined them into one folder. Through installjammer I call the main install dir c:\oldgames\moon. I also point to dosbox.exe as the main executable. When I run installer it creates dir c:\oldgames\moon and dumps all files in it. Dosbox.exe is run automatically. The config is predetermined by what I have done before the installer has even been run. I have included the files as stated in my past reply and it works. I have gotten no errors at all. I do not know how to do screen shot but will learn and show a picture of the post. I have set the config to pause so I could see any errors and there is none. When you push a button to continue it loads the first available cd drive and works without a problem. The first disc of that game is basically all intro but, when it asks for disc two it accepts with no problem.