in reply to forcing STDIN with windows
If the program doesn't accept the input from a pipe, it probably means that it is using direct access to the console or even simply flushing the input buffer prior to prompting.
As it's a console program, I'm not sure if Win32:CtrlGUI will succeed in feeding it input in the right way. If not, then you could also try using Win32::Console and the WriteInput(event) call. Be sure to use the STD_INPUT_HANDLE parameter for the new() call to get a handle to the existing console input buffer rather than creating a new one.
Even this may not work. For instance, if I was righting a program to accept a password from the console and I wanted to ensure that a human being was entering the password rather than a ghost writing program, I might create a new input console just for the purposes of retrieving that password without the FILE_SHARE_WRITE permission and discard it afterwards. In this case, there should be no way for any other program to 'feed' the input. Hopefully, a yes or no answer to a prompt won't have required such precautions:)
Good luck.
|
|---|