batch send "ENTER" key to running program

27,504

Solution 1

check the sendkeys.bat. The script is capable to send a keys to running program with particular title:

call sendkeys.bat "fortran-program" "{ENTER}"

EDIT

try with this script

call nonsecureSendKeys.bat "progfortr" "{ENTER}"

Solution 2

I had the problem recently and this is the easiest/fastest working solution I found:

echo & echo.|fortran.exe

You pipe-in "& echo." (new line) inside the keyboard buffer, waiting to be consumed by the executable.

Share:
27,504
João Palma
Author by

João Palma

Updated on August 27, 2020

Comments

  • João Palma
    João Palma over 3 years

    I have an "old-good" fortran.exe file (without access to the code) and I need to execute a few hundred times using a batch file.

    However, at the end of the fortran program, it prints "Press ENTER to exit", interrupting, of course, the execution of the batch file...

    Is there a way to send the {ENTER} to the running program?