What about redirecting input?

program.exe < keys.txt

where program.exe is the program to run and keys.txt contains the input for the program.

I haven't tried it but I would expect it would work via shell