What about: " echo SOME DATA HERE|gpg ... " This is not valid using just the standard execution methods under windows IIRC, but if you are using the cmd.exe shell it should work. 'echo' is a shell builtin.