Originally Posted By: sparta
I have a "background system" in my script, and i use a while loop to list all *.jpg files in a directory, this working just fine. Now to my problem, i need all images to be named as bla1.jpg - bla2.jpg and so on, any way to do this? and if i have lets say 3 *.jpg files in the directory, then they are named bla1.jpg - bla2.jpg - bla3.jpg , now i put in test.jpg, then it should be renamed to bla4.jpg, any way to do this?

rename <filename> <newfilename>

will rename the file, but i cant solve the thing with the image number, if bla3.jpg = free use it, or if it's taken take bla4.jpg instead..


hmmm

do

var %i = 0
:startrename
/rename <file> <newfile>%i<ext>
/return
:error
inc %i
/reseterror
goto startrename



Beware of MeStinkBAD! He knows more than he actually does!