Build Your Own Arcade Controls Forum
Main => Software Forum => Topic started by: Carsten Carlos on March 05, 2003, 05:34:25 pm
-
Sorry, might be a bit offtopic, but I just can't find it anywhere how to do it!
My little vb-program can execute MAME when it is located in the same folder, but I just can't find how to set the working-directory so I can keep my program anywhere else!
Somehow I can't find anything in the help-file nor at the web. :(
-
I dont know (java programmer)
but have you tried launching
"C:\mame\mame.ext c:\mame\roms\zookeeper.zip"
in java, I can specify the directory to start it in.
-
that won't help.....
Do it like this:
chDrive path
chdir path
btw... fe.donkeyfly.com is the best place for these types of questions.
-
Made sure you you store the current path in a variable before changing path.
myAppPath = CurDir
chDir mamedir
ShellAndWaitA "mame.exe"
chDir = myAppPath
As HC said, goto fe.donkeyfly.com. I just made you a programmer, you can access the programming sections.
-
Umm sirp you haven't had to store the current path since about vb 3.0
The real path to your application is always stored in app.path
It's fixed and thus is unchangable by the user.
-
Is there any point doing the ChDrive / ChDir stuff? I do it before launching an emu but I can't remember why (I send the whole emulator + rom path too).
-
s HC said, goto fe.donkeyfly.com. I just made you a programmer, you can access the programming sections.
Thanx, Howie & SirPoonga, great service, I'll see you there! :)
-
Is there any point doing the ChDrive / ChDir stuff? I do it before launching an emu but I can't remember why (I send the whole emulator + rom path too).
Yes it sets the working directory for the file you have launched. Lets say you launch mame. Now the entire mame exe is loaded into memory as yo run it, so of course it's going to play fine, but when it tries to parse the mame.ini it has no clue where the hell it came from and thus can't find the mame.ini.
Now if you use the createprocess call to launch a game then it's no biggie as the path to the app is an option you MUST send along with the activation string. In other words it sets the chdir and chdrive for you.