0

So I know there are lots of answers on this already, though it seemed like all of them basically suggested that the command should be broken up in some way. In my case I am not sure how this is possible... it is not even a long command. So does anyone have some suggestions on this?

:myLoop

call timeout 3600
cd c:\automation
call ant_env.bat
call ant -f regression.xml upgrade_sequence REM apparently this line is too long...
GOTO myLoop

I have even tried shortening the file name to just regr.xml. This is on Windows Sever 2008 R2 Enterprise

Paul
  • 2,620
  • 2
  • 17
  • 27
  • 1
    Are you sure the error doesn't occur in that `ant` batch file? – wOxxOm Sep 24 '15 at 17:29
  • good point @wOxxOm , I remember when I tried to parse the `%PATH%` with `findstr`, I was getting the same error. `input line is too long` – Paul Sep 24 '15 at 19:16
  • I can run the ant target on its own just fine, the error only occurs when I try to run it from the batch file. –  Sep 25 '15 at 20:46
  • I hope the `REM apparently ...` is not really on the same line, as this wouldn't work in batch – jeb Oct 05 '15 at 14:01

1 Answers1

2

This really depends on what you have inside ant_env.bat, you have to keep in mind that PATH is limited to 260 characters, in case you append it eg.

set PATH=%PATH%;%JAVA_HOME%

and the loop is called continuously, it can lead into a situation where the limit is reached.

You can use (if not defined) as can be seen here : "Input line is too long" error in BAT File

Community
  • 1
  • 1
Tiberiu
  • 2,870
  • 3
  • 20
  • 17