Author Topic: Windows .bat files wont load in Attract Mode  (Read 320 times)

tonberryhunter

  • Full Member
  • ***
  • Posts: 35
    • View Profile
Windows .bat files wont load in Attract Mode
« on: April 20, 2019, 08:14:45 PM »
I cant get .bat files to load within Attract Mode.  They work within Windows fine but not Attract Mode.

Here is my Windows.cfg

Code: [Select]
# Generated by Attract-Mode v2.5.1
#
executable           cmd
args                 /c "[romfilename]"
rompath              \roms\pc
romext               .bat
system               PC Games
exit_hotkey          Joy0 Button6+Joy0 Button7
artwork    flyer           \Attract Mode\scraper\Windows\flyer
artwork    marquee         \Attract Mode\scraper\Windows\marquee
artwork    snap            \Attract Mode\scraper\Windows\snap
artwork    wheel           \Attract Mode\scraper\Windows\wheel

Also here is a sample .bat file

Code: [Select]
@echo off

rem Run game application
cd .\Blade Strangers
start game.exe %*

progets

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 883
    • View Profile
Re: Windows .bat files wont load in Attract Mode
« Reply #1 on: April 21, 2019, 12:23:10 AM »
I cant get .bat files to load within Attract Mode.  They work within Windows fine but not Attract Mode.

Here is my Windows.cfg

Code: [Select]
# Generated by Attract-Mode v2.5.1
#
executable           cmd
args                 /c "[romfilename]"
rompath              \roms\pc
romext               .bat
system               PC Games
exit_hotkey          Joy0 Button6+Joy0 Button7
artwork    flyer           \Attract Mode\scraper\Windows\flyer
artwork    marquee         \Attract Mode\scraper\Windows\marquee
artwork    snap            \Attract Mode\scraper\Windows\snap
artwork    wheel           \Attract Mode\scraper\Windows\wheel

Also here is a sample .bat file

Code: [Select]
@echo off

rem Run game application
cd .\Blade Strangers
start game.exe %*

You're using relative paths but don't define the working dirrectory in the Windows.cfg.

I would try (just to test)...
- use full paths and not relative paths (in both the Windows.cfg and *.bat file)
- define the working directory in the Windows.cfg (this could be problematic)

dukpoki

  • Sr. Member
  • ****
  • Posts: 135
    • View Profile
Re: Windows .bat files wont load in Attract Mode
« Reply #2 on: May 06, 2019, 10:21:40 AM »
Does that exit hotkey combo actually work?  I was always under the impression that you can only assign a single key and not a simultaneous set of keys.  Did they add this ability in the newer nightlies or something?

Enkak

  • Sr. Member
  • ****
  • Posts: 100
    • View Profile
Re: Windows .bat files wont load in Attract Mode
« Reply #3 on: May 06, 2019, 10:40:21 AM »
Here they are working good inside AM with relative paths (you can adapt it to your structure):

executable           cmd
args                 /c "[romfilename]"
rompath              collections\PC Games\roms
romext               .bat
system               PC
nb_mode_wait         5


Sample .bat file

@echo off
set "GAMENAME=yourgame.exe"
set "GAMEPATH=\your game folder name\"
set HOME="%~dp0"
set "GAMEROOT=%~dp0%GAMEPATH%"
cd %GAMEROOT%
start "" /WAIT "%GAMEROOT%%GAMENAME%"
exit


PS: .bat files and games folders are located in the same main folder

Something like:

PC games roms. Inside you have:

Game name folder
.bat file named the same as the game name folder
a cmd.exe just in case.

Hope this helps.