ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From <>
Subject AW: Running <exec> task with an "interactive" executable
Date Fri, 12 Oct 2007 07:26:42 GMT
The input attribut passes the string to the invoked executable. In your case this is "cmd".
But not your "cmd" needs the passwort, the batchfile does. The cleanest way would be using
"-password" option of the batchfile (if it exist). 

Otherwise I would try piping inside the cmd ...

<arg line="${password} | batchfile..."/>


>-----Urspr√ľngliche Nachricht-----
>Von: terrance grahn [] 
>Gesendet: Mittwoch, 10. Oktober 2007 19:30
>Betreff: Running <exec> task with an "interactive" executable
>I am trying to run an executable; however, I keep getting 
>stumped on one
>part.  I am able to run the executable correctly, but there is 
>a point in
>this executable that prompts the user for a password (and then 
>asks them to
>confirm it again).  I want to send this through the Ant task, 
>but nothing I
>use works.
>    <target name="createInstance" >
>        <!-- simple property to be used which will name the 
>instance (assume
>"instance1" is entered) -->
>        <input message="Enter the instance name"
>        <!-- calls the 'createinstance.bat' file and provides 
>the input from
>the arg line -->
>        <exec inputstring="password" dir="d:/oracle/OAS10g/bin"
>failonerror="true" executable="cmd" os="Windows XP">
>            <arg line="/C createinstance.bat -instanceName
>        </exec>
>    </target>
>So this reads the arg line well, but it always errors out 
>because nothing is
>entered for the password.  Here is the output:
>Creating OC4J instance "instance1"...
>Set OC4J administrator password for "instance1" (password text 
>will not be
>displayed as it is entered):
>Error creating new OC4J instance: OC4J administrator's 
>password is null.
>I Guess I need to know exactly how 'input' and 'inputstring' 
>attributes can
>be used with the exec task - I have not seen any examples 
>anywhere that use
>these attributes.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message