segascream Posted January 25, 2017 Share Posted January 25, 2017 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 More sharing options...
CoinTos Posted January 26, 2017 Share Posted January 26, 2017 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? 1 Link to comment Share on other sites More sharing options...
segascream Posted January 26, 2017 Author Share Posted January 26, 2017 (edited) 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 January 26, 2017 by segascream Additional information Link to comment Share on other sites More sharing options...
CoinTos Posted January 26, 2017 Share Posted January 26, 2017 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.exeC:\Users\segascream\LaunchBox\Emulators\NES\fceux.exe %1taskkill /F /im JoyToKey.exe Or you can also use the set command if you prefer that method. Quote set rom=%1start C:\Users\segascream\LaunchBox\Emulators\NES\JoyToKey_en\JoyToKey.exeC:\Users\segascream\LaunchBox\Emulators\NES\fceux.exe %rom%taskkill /F /im JoyToKey.exe 1 Link to comment Share on other sites More sharing options...
segascream Posted January 26, 2017 Author Share Posted January 26, 2017 Holy crap! I can't believe i missed that!! Thank you so much! Link to comment Share on other sites More sharing options...
Recommended Posts