views:

107

answers:

3

I have a DOS batch file that I want echoing turned on. However, this DOS batch file calls other batch files that then turn echoing off. I don't mind that the child batch files turn echoing off for themselves. But, is there any way for them not to affect the main script's echoing?

+1  A: 

Run them with cmd /c . In separate CMD instance.

Instead of:

call otherScript.bat

Use:

cmd /C otherScript.bat

This is of course only relevant if we are talking about Windows NT batches.

EFraim
Good idea. Just be aware however that any EXIT commands would then only exit from the current shell, rather than the whole script.
PaulG
A: 

Unfortunately its not possible. You would have to re-enable (@ECHO ON) echo after calling out to another batch file.

PaulG
A: 

No. Hovewer I'm not sure what will happen if you try to redirect output of a child script to a different stream.

Andrejs Cainikovs