jwb
jwb

Reputation: 11

call ant script in windows cmd with parameters and redirect output

I'm trying to call a windows cmd script that runs ant with a variable number of parameters and redirect the output to a logfile. The reason why I call the script that runs ant is because then I ant returns the control the my calling script in which I can proceed with other stuff. My call fails on the redirect at the end, it looks like the redirect is seen as a parameter.

The call look like this:

call ant_call ant -buildfile %BUILDDIR%\cadis\cm\build.xml -Dcvs.tag=%1 deploy_cmdscripts >> %LOGFILE% 2>&1

Since I have an unknown number of parameters the ant script looks like this

%1 %2 %3 %4 %5 %6 %7 %8 %9

Is there an easy way to solve this?

Upvotes: 1

Views: 851

Answers (1)

Endoro
Endoro

Reputation: 37569

Use %* instead of %1 %2 %3 %4 %5 %6 %7 %8 %9.

%* contains all parameters from the command line, even more than nine.

Upvotes: 1

Related Questions