Driving a windows command line exe programmatically
I have a third party windows executable that does not take command line arguments, but requires various text to be entered at the command prompt (password etc.)
Is there an easy way to drive the text entry at the command prompt programatically so I can create a wrapper for the exe file.
Ideally I'd like to do this in C/C++ but all options will be consi开发者_开发百科dered.
Many thanks for any ideas!
Redirect STDIN of the process. See Creating a Child Process with Redirected Input and Output
You can use "expect" utility to drive programs that are written for interactive text input.
On windows, this is part of "cygwin" package that enables Unix utilities to run on windows.
精彩评论