|I am trying to create a script to rename image files to simply a number sequence(####.jpg). I want it to ask what number to start from then rename all the files in the directory from that number on. So far I have this:|
set /p incr=Enter the starting number:
for %%f IN (*.jpg) do (
ren "%%f" "!incr!.jpg"
set /A incr+=1
And it sorta works. The problem is it sometimes starts at the number specified and sometimes it starts at the next number. I need this to be precise since the numbers have to correspond with database entries. What is wrong? Or is there a better way to do this?