Monday, March 30, 2015

Windows Batch-File to execute and communicate with running program

(How) can a program with interactive command line mode (shell) be programmatically "interacted" with from CMD.exe via batch file (.bat)?
Example:


>program.exe
>>aCommand
>>someResponse
>>anotherCommand
>>someotherResponse
>>quit
>

The batch file should start program.exe, send aCommand, then [optionally] wait for someResponse and so on.


There's How to interact with command-line program using batch file? but does not need automated interaction and so accepts CALL as answer.


Maybe it's possible to start the process separately and then pipe commands and responses to communicate with it?




Elsewhere:

No comments:

Post a Comment

linux - How to SSH to ec2 instance in VPC private subnet via NAT server

I have created a VPC in aws with a public subnet and a private subnet. The private subnet does not have direct access to external network. S...