![Mr. Green :mrgreen:](./images/smilies/icon_mrgreen.gif)
I have a loop that creates some consecutive Variables.
set 1=Hello
set 2=my name is
set 3=mark, and I
set 4=have a DOS problem
set 5=I'm hoping
set 6=you can help me with
The number of variables created is NOT fixed
At the end of the loop, variable %L% is the last variable number
L could be any Number between 5 and infinity
How do you return the value of the last variable but one?
Eg, for the above, I can return:
5
but I need to return:
I'm hoping
The bigger picture:
The variables are lines from a .txt file created by dir.
What I want to do is return the line that gives the size of the directory, then I need to manipulate that, leaving just the number of bytes (I think I can do that).
What I'm looking to do with this batch file is add up and then compare directory sizes. This is the only way I can think of doing it.