# Dos Window Output to TXT



## anthonyfellows

I'm sending out a batch file to several hundred networked pc's with PSEXEC which is a dos tool. Is there a command that I can include in my batch file that will write the contents of the dos window into a txt file? There is so much going on in the dos window, it runs out of room so I can't just copy and paste everything because it's not all there. I'm looking for a command that will write the contents of the dos window to a txt file before it disappears so I can go back and review the results later.


----------



## Squashman

redirect the output to a text file is easy.

> somefile.txt (This will write to a file)
>> somefile.txt (This will append a file)


----------



## anthonyfellows

Tried that. It doesn't write the entire contents of the dos window to the txt file. In fact, All it gives me is success's but doesn't attach a compuer name to those so they do no good. The batch file is going to 500 computers. It also gives me nothing when it fails to connect to the remote computer. I need everything that is in that dos window to output to the txt file.


----------



## JohnWill

Depending on how the text got to the screen, redirection may not work. Can you explain more fully what you are trying to do, and what kind of application is writing to the DOS screen?


----------



## Squashman

If he is using Psexec to launch a batch file on a remote computer, he could dump the entire output of the Batch file to a text file. That is what I thought he wanted to do.

psexec \\computername -c batfile.bat >> somefile.txt

Should work. I think. But I think the output file would remain on the computer you launched the batch file on. You may want to redirect the output to a network share that everyone has access to.

What do you think Johnwill.


----------



## JohnWill

Some DOS applications write directly to the screen. Although that's emulated under Windows, the output doesn't get emitted by the console output. That's why I wanted to know what application is running.


----------

