In a batch file or at the command prompt you can
direct the output to a file. Like this:
DIR /B > LIST.TXT
Will give you a brief directory sent the the new Text file
named LIST.TXT which you can open with NotePad.
If you want to add to the file, you use >> to append
to a file if it already exists.
Works in bartch files for any command that normally sends
output to the DOS box.