tee is a slick little utility that allows piping output to a file as well as stdout (the console). Windows ports for tee exist (wintee, gnuwin32's tee, etc), but all the ones I've tried have the same issue as GNU tee; that is, tee eats the return code from whatever process is piped to it.
For linux, there are various ways to get that return code back (http://lists.samba.org/archive/linux/2004-March/010158.html). How can I get that return code back in windows?
NOTE: I don't want
tee's return code (which is usually zero), I want the return code from the process piped to