Windows Legacy OS forum

General discussion

How to: Send Dos console output to *.txt file?

How to: Send Dos console output to *.txt file?

I would like to keep displaying console output,
but ALSO send it to a file.
Anyone remember how to do this?

Discussion is locked
You are posting a reply to: How to: Send Dos console output to *.txt file?
The posting of advertisements, profanity, or personal attacks is prohibited. Please refer to our CNET Forums policies for details. All submitted content is subject to our Terms of Use.
Track this discussion and email me when there are updates

If you're asking for technical help, please be sure to include all your system info, including operating system, model number, and any other specifics related to the problem. Also please exercise your best judgment when posting in the forums--revealing personal information such as your e-mail address, telephone number, and address is not recommended.

You are reporting the following post: How to: Send Dos console output to *.txt file?
This post has been flagged and will be reviewed by our staff. Thank you for helping us maintain CNET's great community.
Sorry, there was a problem flagging this post. Please try again now or at a later time.
If you believe this post is offensive or violates the CNET Forums' Usage policies, you can report it below (this will not automatically remove the post). Once reported, our moderators will be notified and the post will be reviewed.
Collapse -

In reply to: How to: Send Dos console output to *.txt file?

Collapse -
Yes, that 'redirect output' should work:

In reply to: Here...

Yes, that 'redirect output' should work:
C:\>CONSOLE >dir.txt (redirect output)

But looks like I can't have both console diaplay
and redirect to file.

However, if I could shutOff the redirect,
then I could do:
C:\>type dir.txt

Then at least I could get an afterTheFact of console log.

Collapse -
What about the TEE command?

In reply to: Yes, that 'redirect output' should work:

Collapse -
You do not say what your OS is but ...

In reply to: How to: Send Dos console output to *.txt file?

with Any version of Windows NT (which includes Win 2K and Win XP as well as Vista) what you want is easy as can be.

Let us say that I want to copy console output af a directory command to a text file and also to the console where I can see it. I would enter the following commands (the bolded part is the prompt and the unbolded is what gets typed):

C:\>dir > c:\directory.txt & type c:\direct.txt

Now, that does what I want as sure enough the file directory.txt is there in the C: drive root but the text of the file scrolled past too quick to read. To fix that a little alteration and all is well:

C:\>dir > c:\directory.txt & type c:\directory.txt | more

Now, the screen shows only a sinlge page at a time and can be read at leisure.

That little & (ampersand) in the line I typed is a command separator and allows both commands to run from the same command line.

This Command Shell overview shows you the processing symbols available for your use in the command prompt and how each is used -

Collapse -
It's Stdout not console-out

In reply to: You do not say what your OS is but ...

Quote: "Let us say that I want to copy console output..."

That is NOT "console" output it's standard out.

Console output goes to the console, period.

Stdout CAN be redirected, just about everyone knows that.

Please get your terms straight before posting all over the place online.

Collapse -
Console (screen) output can indeed be redirected ...

In reply to: It's Stdout not console-out

exactly as I indicated 10 months ago.

STDOUT normally goes to the console but can be programatically defaulted to a printer or port.

If you want to get technical please learn the facts and experiment if necessary to educate yourself to the fact that console output can be redirected and does NOT "goes to the console, period. "

This might help your education (just one of MANY sources) --

If you want to pick nits concentrate on your own.

Collapse -
How to: Send Dos console output to *.txt file?

In reply to: How to: Send Dos console output to *.txt file?


Ancient history DOS, but I seem to recall something along the lines of writing this at the command-line:

>copy con: world.txt
Hello, world!

How are you/

I am fine.
Done for now.
(That's typing ctrl-Z as the first-char of the the line)
.. and the OS would your text into the designated filename.



Popular Forums

Computer Newbies 10,686 discussions
Computer Help 54,365 discussions
Laptops 21,181 discussions
Networking & Wireless 16,313 discussions
Phones 17,137 discussions
Security 31,287 discussions
TVs & Home Theaters 22,101 discussions
Windows 7 8,164 discussions
Windows 10 2,657 discussions


This one tip will help you sleep better tonight

A few seconds are all you need to get a better night's rest.