If you want to use a console application as a kind of filter with input redirection, you must check if there are valid characters in the input buffer. Reading from the inputbuffer is not the problem, this could be done by using Console.In.Read() but if you call an application without a redirct, the app will wait until you type in a some charachters and quit that with <Enter>. Also peek waits until you type in something. But this is not the normal behavior the user expects. If you call the app, you expect that something happens, like showing help, but not waiting until I type in something! So during a long time of grabbing web I found the function Console.KeyAvailable(). With that you are able to check, if there is something in the input buffer. But if you use this and redirect the buffer by a pipe, the app throws an exception InvalidOperationException, because the console input was redirected from a file, ecactly what I want to find out. By handling this special exception, we could use this behavior to decide, if the app was called without anything or with a redirection! And that it is what I want to have in my application!