tags:

views:

33

answers:

2

Hi Guys.

I'm writing an ant script to rebuild our database i.e. dropping everything and rebuilding from scratch. The problem our DBA adds a Y/N prompt before executing the rest of the script, and therefore we can't call this from an automated build process.

Does anyone have any suggestions to circumvent the Y/N prompt? Obviously we could create separate scripts, one for the DBA's and one for the automated build - but this requires maintaining both. We're running on Windows so it's not as easy as using sed to strip out the prompt...but I'm thinking something along those lines.

Not sure if that's clear enough but hope you can help.

Cheers.

A: 

Seems like the DBA should be thinking more automation and make the script not pop up a gui yes no dialog. How about they make the yes no a command line option. I think you can jump through hoops to get past this, but push the work on the part of the process that needs to be reworked.

Take a look at AutoIT

This will let you possibly find the dialog and the yes button and automate the clicking. But I still say the DBA should move away from the GUI for this yes no input.

StarShip3000
Sorry i should have made this clearer, but there is no GUI button, it is a command line prompt for a y or n to continue executing the script. Thanks for the input though. I guess we should probably request the DBAs introduce a way of escaping the prompt.
fras85
+1  A: 

Maybe Expect would help?

http://en.wikipedia.org/wiki/Expect

Nate