Page 1 of 1

[SOLVED] Batch file abruptly terminating

Posted: Sat May 05, 2007 10:54 pm
by Ambush Commander
I've been ripping my hair out all afternoon trying to figure out what I'm doing wrong. When I call certain executables (the most flagrant of which is 7z from 7-zip) my batch scripts seem to abruptly terminate after that call, resulting in the rest of the code not getting executed. There are no error messages, etc: the script execution just stops.

Do any of you Windows gurus know what would cause an upper-level batch script to stop executing, and how to suppress it? I hazard it has something to do with error codes, but alas, my google-fu isn't powerful enough to divine the answers to my problems (batch documentation is horrendous!)

Posted: Sun May 06, 2007 7:07 pm
by Ambush Commander
I found that piping the program output to something else (such as cat) fixes the problem. Yay!

Posted: Wed Jul 18, 2007 4:29 pm
by Ambush Commander
Here's an alternate solution:

Code: Select all

call command
Much more elegant.