Computer Hope

Microsoft => Microsoft DOS => Topic started by: eric tyira on August 20, 2004, 11:30:20 AM

Title: running an executable from a bat file
Post by: eric tyira on August 20, 2004, 11:30:20 AM
i'm trying to launch an executable from a bat file.  i want the exe file to run in the system's tray and have the .bat file close.

currently it stays open until it is closed by clicking the 'x' on its window, or by stopping the .exe file.

can anyone help me here?

thanks.
Title: Re: running an executable from a bat file
Post by: johnwill on August 20, 2004, 05:03:43 PM
Put a separate line in the batch file with:

EXIT
Title: Re: running an executable from a bat file
Post by: MalikTous on August 21, 2004, 06:13:59 PM
Including 'exit' as the last line of the BAT file will clear the DOS box once the EXE app has finished. It may be less successful while the EXE runs.

You could try running the EXE from a link/shortcut vice from a batch.
Title: Re: running an executable from a bat file
Post by: johnwill on August 21, 2004, 06:56:04 PM
In Windows, any windows application will allow the batch job to continue.  Since it's loading into the system tray, I assume it's a Windows application.  :)
Title: Re: running an executable from a bat file
Post by: 2k dummy on August 21, 2004, 07:19:48 PM
In win98 you don't even need the exit command. You can tell windows to automatically exit when the batch completes. It is running under pure dos instead of under windows control you will need it. You can do the same thing in 2k and XP if you know the secret. ;D
Title: Re: running an executable from a bat file
Post by: johnwill on August 22, 2004, 10:15:13 AM
Yes, the "secret" is to run it from a shortcut and you get all sorts of run-time options. :)