Super User is a question and answer site for computer enthusiasts and power users. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Suppose I am calling a parent batch file like this

call parent.bat >Log.txt

and within the parent.bat I calling other batch files which themselves call other bath files.

Now whats happening is, the batch files launched from within parent.bat, show their output on the console windows and do not log into Log.txt.

Is there a way to force all child batch files launched to log into Log.txt?

share|improve this question

Try "call file1.bat >> log.txt 2>&1"

The double arrow is important as it indicates append rather then overwrite the file - otherwise you will only get the result of the last file. The 2>&1 redirects "STDERR" to "STDOUT"

share|improve this answer
I tried that. It didn't help. – developer747 Jan 30 '14 at 14:42

With a few experiment, I can't simulate your case. I just doubt if some of ur messages is stderr. If yes, then try c:> call parent.bat >log.txt 2>&1

share|improve this answer

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .