CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 2 of 2
  1. #1
    Join Date
    Oct 2010
    Posts
    1

    display in terminal and log it to a file

    Hello, if I am executing a command in DOS, how can I display it into the terminal window as well as log it in a file. So, for example if I want to do dir to view the contents in C:\, I want to view the contents in the terminal window as well as write the same thing to a file as well. So far I have

    command1 >> C:\\export.log 2>&1

    This will not show anything that command1 executed in the terminal window but rather shows it in export.log file. I want to show in both.

    Any help is much appreciated.

    Thanks
    Sushant Dhakal

  2. #2
    Join Date
    May 2002
    Posts
    10,943

    Re: display in terminal and log it to a file

    Microsoft itself never made this possible. However, you can do it in UNIX. And, even better...you can use the UNIX ported tee.

    http://unxutils.sourceforge.net/
    If the post was helpful...Rate it! Remember to use [code] or [php] tags.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured