1

Could you please help me with the following problem? I have custom.bat file. I set 3 parameters every time for it. I want automate this process. I've tried the following command custom.bat < test.txt. test.txt file contains the following:

no
form_app
no

But only first parameter is redirected to the custom.bat file. How can I redirect all parameters to the custom.bat file? This is my batch file:

@echo off
call ..\setenv.cmd
set JAVA_HOME=%LYRA_JAVA_HOME%
set tmp=%CLASSPATH%
set CLASSPATH=.;%CLASSPATH%
ant\bin\ant.bat -f custom.xml -quiet %1 %2 %3 %4 %5 
set CLASSPATH=%tmp%
wOxxOm
  • 65,848
  • 11
  • 132
  • 136
  • This is custom.bat file @echo off call ..\setenv.cmd set JAVA_HOME=%LYRA_JAVA_HOME% set tmp=%CLASSPATH% set CLASSPATH=.;%CLASSPATH% ant\bin\ant.bat -f custom.xml -quiet %1 %2 %3 %4 %5 set CLASSPATH=%tmp% – Natalia Smirnova Oct 13 '15 at 08:26
  • Is it not simply `custom.bat no form_app no`? – TripeHound Oct 13 '15 at 08:36
  • @TripeHound, no, it will think those are build targets. Should be `custom.bat -DsomeName=no -DsomeName=form_app -DsomeName=no` – wOxxOm Oct 13 '15 at 08:39
  • 2
    Possible duplicate of [Use Ant for running program with command line arguments](http://stackoverflow.com/questions/3730880/use-ant-for-running-program-with-command-line-arguments) – wOxxOm Oct 13 '15 at 08:40
  • Thank you very much, it works – Natalia Smirnova Oct 13 '15 at 09:19

0 Answers0