Automate keystroke input (or choose an option) to start console app using batch file

Viewed 11

I am trying to figure out if it is possible to a) use a batch file to start a console app (i can do this) and then b) automatically enter a keystroke (or similar) to choose one of two options given when the console window initialises.

I have reviewed quite a few of the similar questions on mstack overflow but cannot find a solution.

The window gives two choices 1 which chooses a folder path and 2 local host.

I would like it to choose 1 and proceed.

Currently the message in the console is "No startup parameters detected - Startup Options

  1. c:\path

  2. Server Local host

I then have to hit 1 and the enter key to start it.

In addition if i could then get it to terminate that console after say 5 days or at a set time that would be very helpful.

I did try to find the running instance of the console to use kill but it is proving elusive to say the least.

Thanks Neil

0 Answers
Related