Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Batch file sequential limitation

Status
Not open for further replies.

JBaileys

Technical User
Jun 23, 2003
244
0
0
US

With a batch file, the first command executes and finishes prior to the second command starting.

Is there a way to run all the statements at once like & in a shell script?
 
um.. no.
why dont you tell us what your attemting to do, and maybe we can figure something out.

maybe your looking for a delayed variable expansion...
go to and look up under batch commands "delayed variable expansion". also there is an "&" symbol(command) that could be what your looking for.

what would the benifet be to running all commands at once.
 

Actually I found an answer.

It is "Start". If you prefix the statements with start, it will initate all the statements. Therefore, the script does not have to wait for statement one to finish to begin statement #2.

Simplified Example:
start copy log.txt log.bak
start db2 -tvf create.sql

The goal as stated is to "run all the statements at once" where command 2 does not have to wait for command 1 to start. I was hopeing it was obvious from my initial post.

I am not looking for a delayed variable expansion. Not looking for anything "delayed". In fact, not sure what a delayed variable expansion is.

Let me try to explain the benefit of "running all commands at once". Assume for a second that you drive a car, and you want the ability to play the radio and open the window at the same time. That is what I am looking for :) In a typical batch file situation, I would have to wait until I was done listening to the radio and then I could open the radio. OK this last paragraph may have confused things. I guess to me the benefit seems obvious. Assume you wanted to copy a large log file and at the same time run a sql statement and run a "windows command". In a typical batch mode, you would have to wait for the copy to finish and then start the sql statement and when that was done - start the windows command.

 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top