Author Topic: Starting a batch file.  (Read 5404 times)

Dave305

  • Newbie
  • *
  • Posts: 4
    • View Profile
Starting a batch file.
« on: April 02, 2015, 09:18:18 PM »
How do I start a batch file in AM?. I have this bat file

Code: [Select]
@echo off

set game=2400ad
G:
cd \
cd "G:\Games\Hyperspin\HyperLaunch\Romfiles\Microsoft MS-DOS\ExoDos\"

:Install
IF EXIST ".\games\%game%\" goto run
cd ".\games\games\%game%\"
call install.bat wn
cd ..
 
:Run
IF NOT EXIST ".\games\%game%\" goto none
start .\dosbox\dosbox.exe -conf .\games\games\%game%\dosbox.conf -noconsole -exit
del stdout.txt
del stderr.txt
if exist .\games\CWSDPMI.swp del .\games\CWSDPMI.swp
:unInstall
cd ".\games\games\%game%\"
call install.bat
cd ..
goto end
:none
::::cls
echo.
echo Game has not been installed
echo.
pause
:end

And when I run it it locks up AM.

My setting:
Exe=cmd.exe
cmd arg="[filename]"
rom path=path to my bat files
Ext=.bat

What I Need is a way to start a new cmd.exe from AM, not in the same cmd.exe window and no start /wait won't work from AM or from a separate batch file. Been on this all day and gettin pissed, pls help. Bat file works great outside AM BTW.

Dave305

  • Newbie
  • *
  • Posts: 4
    • View Profile
Re: Starting a batch file.
« Reply #1 on: April 02, 2015, 10:14:11 PM »
WOW, got it to run. I added /k "[ROMFILENAME]" to my cmd arg in AM, but when I exit the game AM it still hangs?. Grrrrrrr.

akafox

  • Hero Member
  • *****
  • Posts: 800
    • View Profile
Re: Starting a batch file.
« Reply #2 on: April 03, 2015, 11:56:06 AM »
Did you get that from the hyperspin fourm? From the looks of it it looks like it starts MS-DOS games (DOSBox?) I'm sure there is a better way..any of you windows users got any ideas? (Damn we have to emulate DOS now...*sigh* I remember when DOS was all you had! lol)
« Last Edit: April 06, 2015, 12:08:37 PM by akafox »
People want life easy..then complain about it

akafox

  • Hero Member
  • *****
  • Posts: 800
    • View Profile
Re: Starting a batch file.
« Reply #3 on: April 06, 2015, 08:12:56 PM »
I did this with Battle Chess because it's what I had. Sorry batteries (game) not included. (use google..sorry that is just how it works)

Ok so I got it to work. Not the best way but it works. In windows it pops up three console windows..but it works.

In Windows make a folder on your C:\ drive and name it dosgames. Place the two files in the dosgames folder.

In Linux make a folder called "games" in your /.dosbox folder. Put the two files in the /.dosbox/games folder.

Grab Battle Chess and when you unzip make sure the folder name is "Battle Chess".  Put that in your "dosgames/games" folder. Then in attract mode Make a new emulator config. (TAB -> emulators->add emulator) Now set up your config. Point it to your dosbox "exe's". Next command arguments set it to [romfilename] Then set your path (Windows: C:\dosgames) or (Linux: /.dosbox/games) Last have it look for (".bat" for windows) or (.sh for linux) for your extension.

I'll see if I can "clean up" the windows side. Linux comes up clean. *shrugs*
Tested on windows XP SP3 32-bit and linux *untu 64-bit.

Seeing as how there are few games that would work in a cab the list of configs should not be too long. I am willing to work with some of you to make a bunch of configs to be used with attract mode if the programmer/developer would like to include them in with the program..or as a separate download "package". (It would at most, I think ,be an extra megabyte added to the attract binary/deb) Anyone got a better idea or want to help let me know! :) Test please :)
People want life easy..then complain about it

raygun

  • Administrator
  • Sr. Member
  • *****
  • Posts: 389
    • View Profile
Re: Starting a batch file.
« Reply #4 on: April 09, 2015, 10:37:27 PM »
WOW, got it to run. I added /k "[ROMFILENAME]" to my cmd arg in AM, but when I exit the game AM it still hangs?. Grrrrrrr.

I think you want to use /c as the cmd arg instead of /k

I'm just going based on the emulator configuration that is included with Attract-Mode for windows_games: https://raw.githubusercontent.com/mickelson/attract/master/config/emulators/windows_games.cfg


hermine.potter

  • Sr. Member
  • ****
  • Posts: 458
    • View Profile
Re: Starting a batch file.
« Reply #5 on: April 10, 2015, 02:04:36 AM »
my three advices:

1) global-settings for all dosbox-games could be found there:
%localappdata%\DOSBox\dosbox-0.74.conf


2) individual settings for each game separate:
- copy the global-settings file of 1) & rename it (e.g. your_game.conf)

- Edit your_game.conf on [autoexec]-section and set following parameters:
Code: [Select]
mount c: path_to_your_game.exe_on_your_filesystem
c:\
your_game.exe

-Create a .bat-file :
Code: [Select]
@echo off
"Path_to_DOSBox\dosbox.exe" -conf "Path_to_conf-file\your_game.conf"


3) create Links and use parameters
- On your game-.exe/.bat > right mouse button > send to > create link (to desktop) > Properties

- use the following parameters in Target:
Code: [Select]
@echo off
"Path_to_DOSBox\dosbox.exe" "path_to_your_game\game.exe" -exit -fullscreen

- then notice the advice of raygun in post#5 : create rom-list for .bat or .lnk-files



Quote
but when I exit the game AM it still hangs?
the -exit parameter should do it for you.

« Last Edit: April 10, 2015, 02:12:49 AM by hermine.potter »
AM Version : 2.4.0
Input : Mad Catz Brawlstick; Mouse; Keyboard; Xbox360 Wireless
Cabinet : Yes
OS : WindowsXP x86 SP3
System : Dell Precision T3500 ; Intel X5650 ; 4GB RAM
Emulators : zsnes; mame; dosbox; scummvm; bsnes; fusion; openbor; windows_games; winuae; video; flashgames; vice; visualboy