1

I've read about this problem on related posts found here at Superuser; however, my issue is slightly different and potentially difficult to solve: I am working with a phylogenetic program called Paup*, and have written a batch script to automate my analysis.

To automate this process, my batch script creates a temporary file containing a series of 'jobs' for Paup* to execute. Thus, my batch file does not interact with the Paup* application directly (Paup* has its own command line interface).

Halfway through each iteration of my analysis, Paup* requests a user input (Y/N format) for an option that I can NOT pre-specify in my job file. I've looked through the command manual and can not find a way to suppress this dialog prompt either.

Essentially, I need to submit a keystroke directly to Paup*, but only when Paup* explicitly asks me for input. Otherwise the submission will go unresponsive since inputs are not queued. Is there a way I can accomplish this?

1

3 Answers 3

0

Im not sure you can accomplish this with batch file but there is a easy 3rd party scripting language that would fit you task. The programm is called AutoIT. You could include your batch script into the AutoIT and then do the y pressing with autoit.

If the command window has a specific name when it waits for input its easy to do with autoit. You can check for the name or title of the cmd window an then press y or n. As well it should be possible in different other ways.

1
  • I'll look into this now, thank you very much Ivan. Dec 29, 2014 at 12:04
0

You could always try looking at the "sendkeys" interface. Have a look at tcc from jpsoftware, which has the ability to send keys to other windows, to see if this is what you want.

0

To use approach that Ivan Viktorovic suggested (about the window name), you can still use VBScript. It's easily done by checking if the window with that name exists, and then sending window name to "AppActivate" and performing Enter key with "SendKeys", and sending appropriate keys to send Y or N. This one would be better if you don't want to download additional software.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.