spool is a command that sends the output from a command to a file (from sqlplus).

As long as it's NT, could you use SUBST?