VOGONS


First post, by mitchrapp

User metadata
Rank Newbie
Rank
Newbie

I'm trying to setup an old foxpro application that requires that the working directory be different from the target directory. This has historically been accomplished via editing the properties of the shortcut and making the "Working" or "Start in" Directory (depending on the version of windows some say working...some start in) different from the target location. Any suggestions on how to accomplish with dosbox?

Reply 1 of 5, by ripsaw8080

User metadata
Rank DOSBox Author
Rank
DOSBox Author

As an example, let's say the application is in the \APP subdirectory, and its data is in \APP\DATA which should be the working directory:

mount c c:\dos
cd \app\data
\app\myapp.exe

The first command mounts the emulated C: drive, the second command makes the \APP\DATA subdirectory the "working" (or current) directory, and the third command executes the application at its "target" location. Note that the working directory doesn't have to be a subdirectory of the target directory like it is in the example.

Reply 2 of 5, by mitchrapp

User metadata
Rank Newbie
Rank
Newbie

Awesome! This was a huge help. I did have to a c: after the mount c c:\dos line. Is it possible to have the working directory be on a different drive than the target location?

Reply 3 of 5, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

Yes, you just have to specify the drive letter appropriately, as in

mount c c:\dos
mount d d:\data
d:
cd data
c:\app\myapp.exe

Reply 4 of 5, by mitchrapp

User metadata
Rank Newbie
Rank
Newbie

That worked perfectly. Last question is there a way to indicate the username dynamically as part of the location...such as mount c c:\users\%username%\appdata\local....I tried %username% but it didn't work. I'm wanting to but the data folder under each users appdata\local folder.

Reply 5 of 5, by Jorpho

User metadata
Rank l33t++
Rank
l33t++

No, there is no (straightforward) way to use "%username%" from within DOSBox. In order to use %username%, you will have to specify the relevant lines in the Windows command prompt or the Windows shortcut when launching DOSBox, as in

dosbox.exe -c "mount c c:\users\%username%\appdata\local" -c "c:" -c "cd data"

and so on.

P.S. Instead of using %username%, consider %appdata%.