# plink 'Invalid handle': how to redirect stdin and stdout?

In my tex file I want to call plink (command line application for PuTTY) in order to execute a remote command and read the output. When I do this I get an error 'Unable to read from standard input: The handle is invalid'

MWE:

   \begin{document}


• have you tried with smt like \immediate\write18{plink -load my_session echo remote_response > bla.out 2> bla.err < bla.in} ? – Bordaigorl Oct 1 '14 at 11:11
• Have you tried creating an empty file bla.in? Is plink usually requiring some user input? – Bordaigorl Oct 1 '14 at 13:15
• Can you try adding the -batch option? – Bordaigorl Oct 1 '14 at 13:16