While creating some Win2k/XP command shell scripts the
other day I came across a strange anomaly in the command
shell processor "cmd.exe".
Normally, to execute a child command shell script from a
parent shell script you must use the "call" command. But
the information on Microsoft's web site...
....states that you can't use pipes or redirection
symbols with "call". This is unforunate since that is
exactly what I would like to do. Microsoft does not
state why this is so, it would be very nice to know.
However, while hacking up a solution to the problem I
found that the following works...without a "call"
child.cmd | more
echo This should not be seen!
You can see in the "parent.cmd" script that I'm executing
the "child.cmd" script without using a "call" command,
yet if you run this you will see that the parent
continues after the execution of the "child.cmd" just
like it had been called.
What is going on here? Is this reliable enough to depend
on? Is it a bug? I can't find any literature on the net
on why this is happening.
Anybody got any clues?