Rotate Rename Numbering files using batch script

810 views Asked by At

EDITE: I have more than 100 file

I have multiple files that I want to rotate every time I run a batch.

How to do it in every SUB-FOLDER?

Here's the concept

Please help. Thanks.

1

There are 1 answers

3
Stephan On BEST ANSWER
@echo off
setlocal enabledelayedexpansion

REM get number of files:
set count=0
for %%a in (*.jpg) do set /A count+=1

REM rename them (decreasing by one):
for /l %%a in (1,1,%count%) do (
  set /a new=%%a-1
  ECHO ren %%a.jpg !new!.jpg
)
REM rename 0 to max
ECHO ren 0.jpg %count%.jpg

remove the ECHOs when you verified it's what you want.