Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

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

2 Answers 2

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 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

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.