PDA

View Full Version : Terminate batch file after program is run.


Samji
04-23-2005, 02:26 PM
On a project I am currently working on I needed to use a batch file to launch Max Payne with the developer and screenshots options.

This is the code I have written for my batch file.



ECHO OFF
CD c:\
CD program files
CD max payne
maxpayne.exe -developer -developerkeys -skipstartup -screenshot
CLS
EXIT


This code works fine, but the prompt window will not disappear until the Max Payne dialog is closed or until the Max Payne engine is started and closed.

Is it possible to make the batch file's window close immediatly after the maxpayne.exe dialog has been displayed.

Thanks. http://forums.3drealms.com/ubbthreads/images/graemlins/smile.gif

Wooloomooloo
04-23-2005, 05:44 PM
Why not use a shortcut instead?

Night Hacker
04-25-2005, 11:19 PM
^What he said... just create a shortcut and add on the command line options to it. Too simple. http://forums.3drealms.com/ubbthreads/images/graemlins/wink.gif

I have my installation software actually create shortcuts for me when my game is installed that do various things with command line options. I find this the best method, and it's more professional looking.

CronoMan
04-26-2005, 04:28 AM
try
CALL maxpayne.exe -developer -developerkeys -skipstartup -screenshot

maybe that helps, I don't know.

addfaz
04-26-2005, 07:33 AM
wont work with batch files. Because of the way batch processing works it'll not execute the next line until the previous one finishes. As your program is still running, it thinks it hasn't finished.

EDIT: on second thought... try adding start before the exe path

ECHO OFF
CD c:\
CD program files
CD max
start paynemaxpayne.exe -developer -developerkeys -skipstartup -screenshot
CLS
EXIT

Samji
04-26-2005, 04:05 PM
Cheers. Adding 'start' worked a treat.
The batch file is not even displayed for a second.

Thank you very much for your support everyone. http://forums.3drealms.com/ubbthreads/images/graemlins/wink.gif