Sunday, 15 September 2013

batch file - Auto supply user input ant exec task -


I have an ant script that runs an interactive (which requires 2 user input). I have tried to use attributes 'input string' (between 2 inputs (between, and in between)) and 'input' (2 entries file)

only the first input to exec function The batch file provided by the script waits for another input indefinitely

Is there a way to provide multiple inputs through an action (or), for an interactive mode batch Inp Is there a DOS command to provide?

Snippet 1: & lt; Exec dir = "F: / upgrade" executable = "cmd.exe" failonerror = "true" output = "upgrade.out" inputstring = "no & amp; amp; amp; amp; amp; Amp; amp; amp; amp; yes; & gt; & Lt; Arg row = "/ c upgrade process F: / script" /> & Lt; / Executive & gt;

Snippet 2:

  & lt; Exec dir = "F: / upgrade" executable = "cmd.exe" failonerror = "true" output = "Upgrade.out" input = "upgrade.input" & gt; & Lt; Arg row = "/ c upgrade process F: / script" /> & Lt; / Executive & gt;   

Input file content

  yes    

This trick is to simulate the press of "Enter" in an input. The code for "ant" has many characters '\ n' character in its XML encoded form unit: & amp; ; # X0A; .

So this should do the trick:

  & lt; Exec dir = "F: / upgrade" executable = "cmd.exe" failonerror = "true" output = "upgrade.out" input = string; & Gt; & Lt; Arg row = "/ c upgrade process F: / script" /> & Lt; / Executive & gt;    

No comments:

Post a Comment