This is tip is applicable to Windows 2000 Professional, Windows 2000 Server, and Windows 2000 Advanced Server.
Use redirection operators like > and >> to spool the output of a command to a file.
Use dir > file.txt to redirect the output of dir to file.txt. The contents in file will be replaced if exists.
Use dir >> file.txt to append the output of dir to file.txt, if it exists; or else a new file is created.
If you want to give input to the program from a file use < redirection.
< is helpful if the program frequently prompts for Y/N/A. Keep some Y's or N's in a file called "file.txt" and redirect it to the program using progname