Sorry your browser is not supported!

You are using an outdated browser that does not support modern web technologies, in order to use this site please update to a new browser.

Browsers supported include Chrome, FireFox, Safari, Opera, Internet Explorer 10+ or Microsoft Edge.

DarkBASIC Discussion / Need a batch file to run my DB programs

Author
Message
krunchy
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United States
Posted: 21st Jan 2003 10:05
I have a DB program split into 3 parts - part1.exe, part2.exe and part3.exe - and I need them all to run back-to-back. It is basically a "movie" that has 3 separate parts. They are not compiled together into one big EXE for a variety of reasons.

Anywa, I tried a standard DOS batch file, but that doesn't work since they all end up trying to run at the same time. (This must be because DOS thinks they have ended execution when in fact they just started running as windows programs.)

Any thoughts on a free & easy solution? Thanks!
Hubdule
22
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 21st Jan 2003 10:22
Try this in the Batch file ... :

@ECHO OFF
CALL Part1.EXE
CALL Part2.EXE
CALL Part3.EXE
Echo Press any key to exit
Pause
exit


Here's some info about that:
"CALL allows batch files to call other batch files (batch file nesting). The calling batch file is suspended while the called (second) batch file runs. When the second batch file finishes, the original batch file resumes execution at the next command. If you execute a batch file from inside another batch file without using CALL, the first batch file is terminated before the second one starts."

Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 21st Jan 2003 14:54
Or alternatively why not just make your DB EXEs call each other at the end of their sequence?

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 22nd Jan 2003 01:13
what's a batch file? is it an executable file you just make with a simple text editor like notepad?

Richard Davey
Retired Moderator
23
Years of Service
User Offline
Joined: 30th Apr 2002
Location: On the Jupiter Probe
Posted: 22nd Jan 2003 01:21
Yes, give it a .bat extension and run it. You probably have an autoexec.bat in the root of your C: drive (even though, on XP, it's usually 0 bytes in size).

Cheers,

Rich

"Gentlemen, we are about to short-circuit the Universe!"
DB Team / Atari ST / DarkForge / Retro Gaming
freak
22
Years of Service
User Offline
Joined: 20th Jan 2003
Location:
Posted: 22nd Jan 2003 01:39
in the batch script you posted, are all three programs launched at the same time or will the next program only launch when the previous is finished?

krunchy
22
Years of Service
User Offline
Joined: 26th Aug 2002
Location: United States
Posted: 22nd Jan 2003 03:48
Well, I tried using CALL and it didn't work. Same behavior still...

Rich, if I use EXECUTE FILE to call the next part, I am getting weird behavior. Even using it as the last statement in the program, I think the next part is trying to run and init DirectX before the previous has finished closing it....? So far it hasn't worked reliably via this method.

Any other ideas? It seems so simple, but, for some reason, ain't!
Hubdule
22
Years of Service
User Offline
Joined: 3rd Sep 2002
Location: Gundelsheim
Posted: 22nd Jan 2003 12:08
Create P1.BAT,P2.BAT,P3.BAT ... write the following in there:

@echo off
part1.exe

and in the second:

@echo off
part2.exe

third:

@echo off
part3.exe

then create a fourth one (Parts.bat) and write:

@ECHO OFF
CALL P1.BAT
CALL P2.BAT
CALL P3.BAT
Echo Press any key to exit
Pause
exit

This should work ... *hopefully

Login to post a reply

Server time is: 2025-05-15 08:59:51
Your offset time is: 2025-05-15 08:59:51