Hsiao Yi
Hsiao Yi

Reputation: 135

How to skip the procedure needed to press any key to exit the exe in batch file

I'm writing a batch file under windows and I have an executable(*.exe) to perform some tasks

Despite the task I needed have been done

But it seems that the executable has a mechanism to press any key to exit

I can't proceed to execute next line of my batch file

Because I need to execute this .bat by other program automatically

I need to skip this procedure to execute whole .bat

Does it have any method to do this?

Upvotes: 2

Views: 2629

Answers (1)

Klitos Kyriacou
Klitos Kyriacou

Reputation: 11621

It all depends on how your executable inputs a keystroke. It may be impossible, but you might try one of the following in your batch file:

*executable* < nul

or

echo x|*executable*

(replace "*executable*" with the actual name of the executable.)

Upvotes: 3

Related Questions