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
2009-08-03 18:19:34
Good idea. Just be aware however that any EXIT commands would then only exit from the current shell, rather than the whole script.
PaulG
2009-08-03 18:31:03
A:
Unfortunately its not possible. You would have to re-enable (@ECHO ON) echo after calling out to another batch file.
PaulG
2009-08-03 18:20:21
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
2009-08-03 18:20:42