Re: Redirecting the standard error and output

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance

From: Jochen Kalmbach (nospam-Jochen.Kalmbach_at_holzma.de)
Date: 03/03/04


Date: Tue, 02 Mar 2004 23:38:29 -0800


=?Utf-8?B?QmFuc2lkaGFy?= wrote:

> I want to redirect my program output to some file. I could do for
> standard output by following command
>
> myapp.exe > out.txt
>
> But I was not able to redirect my error messages from the above
> application to same file. Which the command for redirecting both error
> and output at the same time?

myapp.exe > out.txt 2>&1

For more info see: Using command redirection operators
http://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en
-us/redirection.mspx

-- 
Greetings
  Jochen
  Do you need a memory-leak finder ?
  http://www.codeproject.com/tools/leakfinder.asp


Relevant Pages

  • Re: last character of the last line is a newline?
    ... Would it be possible to redirect only to a file. ... output to standard output. ... # to stdout and to your_file ... Substitute your_program by the compound command of your original posting: ...
    (comp.unix.shell)
  • Re: nohup
    ... i am not sure about this command. ... standard output or standard error - the '>outputfile' would redirect ... standard output to 'outputfile', and the '2>&1' would redirect standard ...
    (comp.unix.aix)
  • Re: [SLE] Manipulating raw
    ... >> no listing of the error messages on redirect. ... The above command says to ...
    (SuSE)
  • Re: Redirection output for a program in background
    ... the command line, with pipes and greater-thans and so on. ... But since it's started at boot, I have no access to the output that's ... to redirect the standard output on the fly to a terminal ...
    (comp.os.linux.misc)
  • Redirecting the standard error and output
    ... I could do for standard output by following command ... But I was not able to redirect my error messages from the above application to same file. ...
    (microsoft.public.vc.language)