Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to Log Console Screen into a Text File? [duplicate]

Possible Duplicate:
Mirroring console output to a file

I've a console application in C# and I want to Log into a text file every text appears on the screen. How to do that ?

Unfortunately this thread is closed despite of my comment about the Mirroring console output to a file. The accepted post as answer by that thread IS NOT CORRECT. So why cannot ask the question again? I'm using console interactively and want a copy of all the text on console in a text file. SOS

like image 744
Xaqron Avatar asked Oct 08 '10 00:10

Xaqron


People also ask

How do I save console WriteLine output to a text file?

WriteLine(sRes); SW. Close(); Console. WriteLine("File Created"); reader. Close();

How to write console output to file?

To redirect the output of a command to a file, type the command, specify the > or the >> operator, and then provide the path to a file you want to the output redirected to. For example, the ls command lists the files and folders in the current directory.

What command do you use to output data to the screen?

You can use the tee command to output text from a command both to the screen and to a file. The tee command takes data from standard input and writes it to standard output as well as to a file.


1 Answers

C:\>yourconsoleapp.exe > yourtextfile.txt

edit: This assumes your console app requires no user input.

like image 134
Kyle B. Avatar answered Sep 24 '22 18:09

Kyle B.