DeE DEe
DeE DEe

Reputation: 335

Pass Enter Key in Batch File

I have used start /wait to run the exe. After exe is complete it asks for Press any key to continue. How is it possible to pass Enter Key through same batch file?

Upvotes: 1

Views: 5795

Answers (1)

Joey
Joey

Reputation: 354416

This depends on the application in question and how it processes input. In most cases you should be able to just pipe input to the program:

echo.|some.exe

If they are reading from standard input, they will read a line break in this case. E.g. echo.|pause prints Press any key to continue . . . and exits immediately.

Within start /wait you likely need to wrap it into another cmd call:

start /wait cmd /c "echo.|some.exe"

Upvotes: 4

Related Questions