Jump to content

Redirect Console Output/Error for logging/testing


Recommended Posts

I just found out something really useful after tearing my hair out because I couldn't figure out a problem with one of my unattended application installs. Not seen this posted anywhere so thought I'd share it.

SomeCommandOrApp >> output.log 2>&1

Basically the last part says redirect error output to normal output which is also redirected (and appended in this case) to output.log. Now I know all about stdin, stdout and stderr but I didn't realise you could redirect stderr as well. This appears to be a new thing in XP (new .. cough .. 5 years old .. cough :whistle: )

For more info Microsoft have a page on it.

Now I log all my output so I can see when an app/command didn't run properly.

Hope other find this useful.

Link to comment
Share on other sites


Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...