Showing posts with label commandline. Show all posts
Showing posts with label commandline. Show all posts

Wednesday, August 5, 2009

How to redirect stdout and stderr in windows

Basic redirection of stdout:

somecmd.exe > outfile

To redirect stderr to the same file, just redirect stderr to stdout:

somecmd.exe > outfile 2>&1

Monday, December 15, 2008

When is a Comment not a Comment

Ouch!

I've seen some really odd things in my day, but this one takes the cake. A comment with a side-effect!

Its my *FAVORITE* language DOS command language. Error statuses are stored in ERRORLEVEL variable, and that gets returned to the caller.

Problem is, a REM resets ERRORLEVEL back to zero if it is non zero. I guess its telling me the comment was successful?

Happy coding,

The Schmitzer