Fixed redirection of output from script to the console for Windows (#750)