开发者

Batch to start DOS app and then type things to it?

I have a prop开发者_开发知识库rietary command line exe that prompts for username and password. Unfortunately it doesn't accept command line arguments for these. I need to make a batch file that will start the exe then type "user" then type "pass" and have it actually go to the stdin of the exe. This is on Windows Server 2003.


You could try the following:

(ECHO username& ECHO password) | yourprogram.exe

That is, if I understood your situation right.

Note the absence of a space before &.


UPDATE

Based on your reply to my comment, the above suggestion should probably be extended like this:

(ECHO username& ECHO password& ECHO Yes& ECHO Yes& ECHO Yes) | yourprogram.exe
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜