My problem is pretty simple, but I'm unsure why I am seeing this behaviour. I want to get a list of parameters down to a single entry at a time so I can do some processing on them. The list of jar files I am processing is separated by a ; delimiter.
set JARS=this.jar;that.jar;and.jar;the.jar;other.jar
for /f "delims=;" %%a in ("%JARS%") do echo.%%a
I'm expecting the script to exit listing as follows.
this.jar
that.jar
and.jar
the.jar
other.jar
C:\>
But the script is instead exiting as follows.
this.jar
C:\>
I'm clearly missing something obvious, but I can't seem to see it.
I'm using Windows 7.
FOR /Fwill parse the content line by line first, then use the delimiter to separate the line into tokens. In your case, the content ofJARSis on a single line, so you only get the first token.