Discussion Locked

How do I start an app. in the background

0 helpful
5 replies
Closed to new repliesThis discussion is closed. It stays readable, but it takes no new replies.

The problem I am having is a batch file I use executes a line to run the program I want it to, then it waits until the program ends to finish executing the rest of the batch file. I think I way to get around this problem would be to have the batch file start the program in the background, but I am not sure how, or even if this will solve my problem. Basically, I want the batch file to continue executing the rest of the lines in the batch file, and not wait until the program it has opened has been closed, like it is doing now.

Thanks for any help you can provide.

5 replies

by jeremy the it guy

There are a few ways to do this. You could have that batch file start another batch file before it tries to start that program. Then, you will have two batch files running and if the one openning the program takes a few seconds, the other one has already started and will finish. Another thing is to put everything you want to run ahead of the program you are trying to execute. Here is an example:

@echo off
net time \\server1 /set /yes

@echo off
if '%OS%' == 'Windows_NT' goto NT_OS
net config | z:\program.exe
exit

:NT_OS
program.exe
exit
Hope this helps, Jeremy

by cp409sd

Thank you for the good ideas. Unfortunetely, the program which the batch file is executing will continue to run after the batch file has finished. I could have one batch file spawn another one, and then that one start the program, but I am still left with the same problem. Thanks.

This discussion is closed to new replies.