I scoured the web and could not find the exact code I'm looking for... I found things that are very similar but did not get them to work. Here is a rough idea what I want:
int i = 1;
FOR (i; i < 9999; i++)
IF EXIST filename.log THEN
REN filename%i%.log
ELSE IF EXIST filename%i%.log THEN
REN filename%(i+1)%.log
Basically I want to check if a filename exists and if so, rename it to filename0001 -- from there on, each time the batch is run, if filename#### is found, it renames it to one after that. So of course after the first time this is run, when it finds that filename exists it will rename it to filename0002 and so on.
Thank you!!