As grumpy said, this question is language agnostic. As it is referring to OS redirection of the standard input/output.
The solution is simple; in windows, you can run the program like this:
...