VOGONS

Common searches


First post, by ironman288

User metadata
Rank Newbie
Rank
Newbie

I am trying to run DOSBox from a flash drive so I can use it on multiple computers, and have managed to install DOSBox and all my games without a problem. However, the autoexec runs some dosbox commands to mount the drive before i can access my games and when switching between PC's the drive letter will change.

If i could use a .bat file to enter some commands into DOSBox once it is open I would use the current directory code, which i have found to be: "%CD%" (is this correct?) but I can't seem to have a .bat file enter text into the DOSBox prompt, nor can i run a .bat in DOSBox without mounting first, thus making it impossible to make a .bat to mount my directory for me.

It also seems that a true .bat file will simply run in the directory it is in, so a simple

mount c: %CD%\portableapps\dosbox

should do the trick if it's possible to use commands from files other than the normal autoexec file.

So is it possible to have DOSBox open to the drive it is installed on by default (which is NOT dangerous for me since it is a flash drive), or to make it somehow read what drive letter it is on dynamically, or am I doomed to have to manually mount each time i go to a computer other than my own?

So a quick recap: autoexec allows me to auto-mount to a static drive letter ("J" in my case) but I want to have it mount dynamically on each new machine (so that if the drive letter becomes "G" on a computer it will still mount the DOSBox folder).

Yes I know i only have to type two commands if i end up looking up the drive letter myself but i would still rather not :p

Reply 2 of 7, by butterfly

User metadata
Rank Member
Rank
Member

I hope my method could help.
(this will hopefully work if the games are on the same flash drive as the portable emulator)
Let's just keep on taken I have two folders:

[Main folder (aka ..\)]
|
-----------------
| |
[DOSBox] [DOS]

I can use the mount command like this:

mount c ..\DOS

or, assuming I have an INVADERS folder within the DOS folder:

mount c ..\DOS\INVADERS

In both cases "c" is obviously the DOSBox drive letter.

Reply 3 of 7, by ironman288

User metadata
Rank Newbie
Rank
Newbie

this works from the standard autoexec file, I tried in on two different computers with two drive letters to make sure 😁

The second response did not work for me, but thanks for posting.

Reply 4 of 7, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

What butterfly posted does work, it just uses a different directory structure,
have a look again at the very first lines he posted. It separates the dosbox
directory better from the actual games' directories.

Reply 6 of 7, by ironman288

User metadata
Rank Newbie
Rank
Newbie

I do already have the game inside a seperate folder. What i ended up using is:

mount c  .\classics
C:

for whatever reason it didn't seem to recognize any command when i used what butterfly posted, which i interpret as this:

mount c ..\classics
C:[code]

the second period just throws off the command i guess, or i read it wrong.

Reply 7 of 7, by wd

User metadata
Rank DOSBox Author
Rank
DOSBox Author

.. is the parent directory, so if you have dosbox in
k:\dosbox\
and the game in
k:\games
it works like butterfly said, first changes to the root (..) then to games
by using mount c ..\games
If you have
k:\dosbox\games
you need mount c .\games (not sure if mount c games would even suffice).