How do you enter something at a DOS prompt Programmatically?

后端 未结 3 1161
温柔的废话
温柔的废话 2020-12-14 09:37

I have program, that must interact with a DOS program before my program can continue what it is doing. I\'m trying to avoid my user from having to interact with this dos pro

3条回答
  •  暗喜
    暗喜 (楼主)
    2020-12-14 10:19

    You can pipe in a 'y' character into the program like so:

    echo y | executable.exe
    

    Multiple lines can be entered like so:

    (echo y
    echo n) | executable.exe
    

    ...which will pass first 'y' then 'n'.

    See tip from Microsoft here.

提交回复
热议问题