The problem i'm having with the batch method, is every time I start a game in AM, it will boot but will be playing in the background with AM in focus instead. I'm not sure what i'm doing wrong, or even how to fix this. Here is a sample of a batch file for a game:

I have another problem. I tried creating batch files for Retroarch using a Sega CD game and tested it in AM to see if the same thing would happen (focus lost in the background) however, with the Retroarch batch, the game doesn't even boot at all. Using Attract-console, I see that it launches the batch once selected but nothing ever transpires from it. Note that the batch itself works perfectly fine when you double click it outside of AM.

Note that the batch itself works perfectly fine when you double click it outside of AM.

Same thing is observed by me launching AM -> MAME 0.78, vs launching MAME 0.78 directly (without AM). Runs fine without AM, but with AM I have to either have any random application('s window) set to "always on top", or have terminated Explorer.exe (the shell), or run AM in windowed mode. Just for the purpose of gathering knowledge, have you tried having some application window "always on top" (while NOT minimizing that window) ? Try Task Manager and click menu item Options -> Always On Top. Then without minimizing that Task Manager window, launch AM and a game/bat, will it work then ? If yes, then we at least know that you are likely suffering the same probelm as me. To further verify, you should download Process Monitor. It's available for download at microsoft: https://docs.microsoft.com/en-us/sysinternals/downloads/procmon

If you download Process Monitor, I can help you to create a filter (not related to AM filters) for pcsx2.exe, and see how long/short that process runs. There is far more info provided by Process Monitor, but as I'm new and haven't learned much, I will go no further. And I write "help" because Process Monitor filters can be confusing for the beginner, but simple once you grasp them. If you're interested let me know.

Note that the batch itself works perfectly fine when you double click it outside of AM.

Same thing is observed by me launching AM -> MAME 0.78, vs launching MAME 0.78 directly (without AM). Runs fine without AM, but with AM I have to either have any random application('s window) set to "always on top", or have terminated Explorer.exe (the shell), or run AM in windowed mode. Just for the purpose of gathering knowledge, have you tried having some application window "always on top" (while NOT minimizing that window) ? Try Task Manager and click menu item Options -> Always On Top. Then without minimizing that Task Manager window, launch AM and a game/bat, will it work then ? If yes, then we at least know that you are likely suffering the same probelm as me. To further verify, you should download Process Monitor. It's available for download at microsoft: https://docs.microsoft.com/en-us/sysinternals/downloads/procmon

If you download Process Monitor, I can help you to create a filter (not related to AM filters) for pcsx2.exe, and see how long/short that process runs. There is far more info provided by Process Monitor, but as I'm new and haven't learned much, I will go no further. And I write "help" because Process Monitor filters can be confusing for the beginner, but simple once you grasp them. If you're interested let me know.

FYI, I just tried the task manager with Always on Top enabled but it didn't work for me. PCSX2 still runs in the background with AM in focus instead.

When I first your first comment, and before reading the scipt you included, I was about to suggest "start /c ..." as well. But as it turned out for you, that was a/the problem. Btw, there are plenty crazy things about cmd.exe, enough to make Bash to appear quite sane, hehehe. No command substitution being one, you instead have to use:

for /f ["<options>"] %<single-letter-variable> in ('<substituted command>') do <processing command goes here, it has access to %single-letter-variable, which is the output of 'substituted command'>(the percent character/sign must be doubled (%%) in scripts of course, single ones are only for immediate commandline)

And there are limitations as well as dangers with that workaround.Also, sometimes in cmd.exe you have to use "cmd /c <command>" rather than just "<command>", or things won't behave as expected and break. It's a mess, and more so to remember all these exception-al behaviors.

I've done some N64 RetroArch batches and they work fine with AM. It only seems to be my Sega CD batch that doesn't work. Upon further testing I think the problem is the directory naming convention (look at the rompath in particular).

executable cmdargs /c "[romfilename]"rompath E:\Emulation Data\Sega Genesis & CD\batchromext .batsystem Sega CDIf I change it to this it works (I'm also moving the actual batch folder in explorer to match of course):

executable cmdargs /c "[romfilename]"rompath E:\Emulation Data\Sega_CD\batchromext .batsystem Sega CDSo in conclusion, the problem is either the "&", the "CD", or both, probably preceded by a space. I've tried putting the whole path in quotation which didn't really do anything. I am now completely stumped as to reasoning why this wouldn't work. Also another odd thing about all this is that the original rompath with the spaces, "&", and "CD" was working just fine in the rompath field before I started switching over to batches. Weird. Of course, the easy solution is to just rename the folder to say "SegaCD" or "Sega_CD", which i'm totally doing. But it would be nice to understand exactly where and why it's throwing off the code.

EDIT: The problem is the "&". I've tried "SegaCD CD", "SegaCD &" , "Sega_&". Anytime there's an "&" it seems to not work. Still not sure why it doesn't work for batches while "&" is totally fine to use in the rompath any other time.

So i have the emulator in AM with no issues . When i start a game, it boot up, and i can play it, BUT the focus is on AM palyout yet, so, if i push a button playing ps2 game, just Start another instance of the same game ...

So the problem is that Atttract mode don't "sleep" while i'm playing ps2 game ... Obviusly the issue happens ONLY with PCSX2 ...

Any solution i've just tried the other solution that you have suggested on this topics, but no success ...

So i have the emulator in AM with no issues . When i start a game, it boot up, and i can play it, BUT the focus is on AM palyout yet, so, if i push a button playing ps2 game, just Start another instance of the same game ...

So the problem is that Atttract mode don't "sleep" while i'm playing ps2 game ... Obviusly the issue happens ONLY with PCSX2 ...

Any solution i've just tried the other solution that you have suggested on this topics, but no success ...

any specific reason you are using bat files for pcsx2? Call the emulator directly or edit bat files to use this argument > "[romfilename]" --fullscreen --nogui

Rand0m , i prefer to use the batch files because some games needs DX11 and other needs OpenGL driver, so i need to load PER-GAME configs, and this is possible only with batch files. Or is possible to load configs directly from attract mode Emulator CFG ??

So i have the emulator in AM with no issues . When i start a game, it boot up, and i can play it, BUT the focus is on AM palyout yet, so, if i push a button playing ps2 game, just Start another instance of the same game ...

So the problem is that Atttract mode don't "sleep" while i'm playing ps2 game ... Obviusly the issue happens ONLY with PCSX2 ...

Any solution i've just tried the other solution that you have suggested on this topics, but no success ...

Rand0m , i prefer to use the batch files because some games needs DX11 and other needs OpenGL driver, so i need to load PER-GAME configs, and this is possible only with batch files. Or is possible to load configs directly from attract mode Emulator CFG ??

You can create per-game configs, You can use some thing like spectabis (easier) as launcher and use it in Am or use config files directly. I am using the following setup:

executable D:\PlayStation 2\PCSX2 1.5.0 dev-2325 (x32)\pcsx2.exeargs "[romfilename]" --fullscreen --nogui --cfgpath="D:\PlayStation 2\Extras\Game Configs\[name]"1- [name] here means that pcsx2 will look for config file with similar name to currently selected rom - a handy am function2- Create 2-3 templates like dx11, opengl and software, it will make it easier to manage if you have large romset.3- spectabis > https://github.com/FaithLV/Spectabis/blob/master/README.md (try not to add any flyers, large list with flyers can cause huge slowdowns)

Using the NON-BLOCKING-PARAMETER, all is good , BUT i can't exit the game by the controller combo even ... AARGHHH !! i think this is the best that i can have ...

any suggestion ??

Try deleting this line from your AM configuration file and assign/use the buttons/keys inside pcsx2 to exit the emulator. This will exit pcsx2 which will then put focus back on AM (at least is does for me but I might not have the latest pcsx2).