Perhaps a short exxplanation is in order. DOS commands like '|' pipe and '>' redirect require the command interpreter. When you run it from a DOS prompt, you have the interpreter loaded. When you shell to a command, you need load the interpreter hence the %comspec%.
_________________________
Give a man a fish and he will be back for more. Slap him with a fish and he will go away forever.