Jump to content
LaunchBox Community Forums

Batch files for emulators


segascream

Recommended Posts

I started using Launchbox a few months ago, and I love it. However, I've run into a bit of a problem (actually, a chain of problems that I finally ran out of solutions for).

I've been using Launchbox for both my emulators and PC games, and I've been using JoyToKey for all my PC games. I had my emulators configured for my 2 bluetooth gamepads, but for some reason they occasionally get confused on Win7. (They'll sometimes appear in emulator input configs as Joy0 and Joy1, but sometimes Joy1 and Joy2, and then last week they both randomly decided to identify as Joy255.) Anyway, it appears I don't tend to run into those issues in JoyToKey, so I wrote a batch script to, when I click on a given ROM in Launchbox, have it fire up the appropriate emulator and JoyToKey with the correct profile loaded. It all works great, except....

I can't seem to figure out how to get this batch file to pass the selected ROM to the emulator.  I'll click on a game, it'll open the emu and JoyToKey, but it doesn't actually load the game info the emu.

Can anybody give me some clue as to what I'm missing?

Thanks 

 

Link to comment
Share on other sites

If you like, post the batch script and I will take a look at it. I am guessing you are using LaunchBox to launch the batch script in place of the actual emulator executable. 

Flow is basically:
-> launch game in LaunchBox
-> LaunchBox passes the rom filename and path to batch script
-> batch script launches joytokey with profile
-> batch scrtipt launches emulator with passed rom filename and path

You are then running into trouble getting the emulator actually running the passed filename and path from LaunchBox when launched from the batch script, correct?

  • Like 1
Link to comment
Share on other sites

Yes, that's it exactly! It seemed a hell of a lot easier to write a batch script to do this rather than go through and assoxiate JoyToKey to 600+ roms.

So, this was just the test script I wrote. Testing it on my NES emu: my plan was to write the script, test it, and then adapt it for all my other emus once i was satisfied.

Quote

start C:\Users\segascream\LaunchBox\Emulators\NES\JoyToKey_en\JoyToKey.exe
C:\Users\segascream\LaunchBox\Emulators\NES\fceux.exe
taskkill /F /im JoyToKey.exe

If you could give me some idea of where I'm going wrong, I would greatly appreciate it. Thanks.

EDIT: I should probably also mention that I've got JoyToKey in every single emulator and PC game directory, so that i never have to mess with trying to make sure the correct profile is being used.

Edited by segascream
Additional information
Link to comment
Share on other sites

You need %1 to pass the variable that LaunchBox passed to the batch script to tell the emulator what to load.

Quote

start C:\Users\segascream\LaunchBox\Emulators\NES\JoyToKey_en\JoyToKey.exe
C:\Users\segascream\LaunchBox\Emulators\NES\fceux.exe %1
taskkill /F /im JoyToKey.exe

Or you can also use the set command if you prefer that method.

Quote

set rom=%1
start C:\Users\segascream\LaunchBox\Emulators\NES\JoyToKey_en\JoyToKey.exe
C:\Users\segascream\LaunchBox\Emulators\NES\fceux.exe %rom%
taskkill /F /im JoyToKey.exe

  • Like 1
Link to comment
Share on other sites

  • faeran locked this topic
Guest
This topic is now closed to further replies.
×
×
  • Create New...