Page 1 of 1

Creating a simple batch simulating hitting enter key

Posted: 24 Dec 2014 11:48
by jackhandy
I am trying to write a simple batch program to automate me hitting the enter key. There is a program I am running that requires me to start 1 batch program that doesn't require any user input. Then I start another batch program that requires me to hit the enter key once. Then I start another batch program that requires me to hit the enter key twice. Is there a way to write 1 batch program to automate this? Thank you.

Re: Creating a simple batch simulating hitting enter key

Posted: 24 Dec 2014 12:34
by npocmaka_
try to call the program that requires enter like that:

Code: Select all

break|call requires_enter.bat

Re: Creating a simple batch simulating hitting enter key

Posted: 24 Dec 2014 14:41
by Liviu
Or...

Code: Select all

<nul call other.bat
...which runs the secondary batch in the same cmd session so, for example, it can pass environment variables back to the caller.

Liviu