Take the 2-minute tour ×

in visual studio 2005 how can i save whats written to the out put window to file (i cant change the code writing to the output window and it writes a lot i just want to save the output window content to file)

thank you Arik

share|improve this question
Too little information to answer. What language (C++, C#, VB.NET)? What framework (MFC, ATL, Windows Forms)? What output format (text, picture with snapshot of the window)? What target (entire window, a specific control)? Etc etc. Nobody can help you without more details... –  Mihai Limbășan Jan 7 '09 at 12:40

6 Answers 6

"File" -> "SaveOutputAs..." let's you save the contents of the output window to a file, but I imagine you want to redirect the output to a file while debugging? I'm still looking for a way to do that myself..

share|improve this answer

If you mean the output to the debug/trace window.
You can capture this at runtime with debugview without running visual studio.

share|improve this answer

If the app runs in a command window, you can use the old DOS redirect command ">" to redirect the output to a file.

For example.

c:\>dir > out.txt

...will redirect the output of the dir command to a file called out.txt. You should be able to do the same with your application.

This will stop the output from going to the console, but you can always go the log file to get you the info you want.

share|improve this answer
There are programs that can be piped to, and will split the output (e.g. tee on unix systems). This does not, however, capture the VS output window: that one's populated by ATLTRACE calls, and can be captured by ATLTraceTool. –  xtofl Jan 7 '09 at 21:31

ATLTrace Tool intercepts the ATLTRACE calls. You can save the output of any process into a file.

share|improve this answer

Are you developing in .NET? And what is the code used to write to the output window?

In case you are using Trace.WriteLine or Debug.WriteLine you could use a TextWriterFileListener class to write all messages to a file automatically.

share|improve this answer

Just answered a very similar question here. I'm using this method myself to capture, filter and log debug output to a file on Vista 32. I use Visual Studio 2005 and work in C++, so this might help you too.

share|improve this answer

Your Answer

