Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 9185389
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:15:53+00:00 2026-06-17T19:15:53+00:00

While debugging I want to display console output both on console and save a

  • 0

While debugging I want to display console output both on console and save a backup in file.
Windows doesn’t have tee, but you can add one. Say the folder is c:\bin\ and it works fine. And I have added it into system’s PATH.

Problem is setting “[ ]| tee[.exe] output.txt” or ” | tee[.exe] output.txt” won’t work — the output.txt is just nowhere to be found. I also tried to add the c:\bin\ path explicitly in VC Directories or environment under debugging and merge environment to be yes.

“> output.txt” works fine.

Anyone has any idea how I can resolve this? Many thanks!

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-17T19:15:54+00:00Added an answer on June 17, 2026 at 7:15 pm

    I assume that you’re putting the | tee.exe output.txt string in the project property “Debugging | Command Argument”.

    Unfortunately, that property only supports the redirection operators, not the pipe operator. If you have the | tee.exe output.txt string in the preoperty and run a program that dumps the command line arguments, you’ll see that that information is just passed on as the arguments. The “Debugging | Command Argument” doesn’t actually get processed by a full-fledged shell (such as cmd.exe) – it’s just the IDE supporting some simple redirection (actually, it seems to support more than I expected):

    From http://msdn.microsoft.com/en-us/library/kcw4dzyf.aspx:

    You can use the following redirection operators in this box:
    
        < file
            Reads stdin from file.
    
        > file
            Writes stdout to file.
    
        >> file
            Appends stdout to file.
    
        2> file
            Writes stderr to file.
    
        2>> file
            Appends stderr to file.
    
        2> &1
            Sends stderr (2) output to same location as stdout (1).
    
        1> &2
            Sends stdout (1) output to same location as stderr (2).
    

    You can have a limited version of what you’re looking for by redirecting the program’s output to a file using >> and using a tail-f command to display whatever gets added to the file. If you do this you’ll probably want to call setvbuf( stdout, NULL, _IONBF, 0 ) first thing in main() so that I/O is unbuffered. Otherwise tail -f won’t see it until the buffer gets flushed, and I imagine that you’d like to see each output operation as it occurs.

    Another option is to crank the console window’s “Screen Buffer Height” property up to a large number – one of the first things I do when I get a new Windows machine is set that value to 3000 or so – then debug the program normally and copy/paste the contents of the console window before it closes.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to throw exceptions while debugging but in release mode I don't want
I want to display the entire content of a TStringList while debugging the application.
Can I pause a thread while debugging on intellij? What I want to have
While debugging an issue with our system, I have discovered a thread contention that
While debugging jQuery apps that use AJAX, I often have the need to see
While debugging a problem in a WPF application, I have noticed that the TwoWay
I want my program to be able to launch any Windows game, and while
When an exception is thrown (while debugging in the IDE), i have the opportunity
I want to do trace or log messages to a debug window while debugging
i am getting crash in the thread. while debugging coredump with gdb, i want

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.