@echo off setlocal enabledelayedexpansion for %%x in (*) do ( if not "%%x"=="demo.bat" ( set /a sum+=1 rename "%%x" "!sum!.jpg" ) ) pause
@echo off setlocal enabledelayedexpansion for %%x in (*) do ( if not "%%x"=="demo.bat" ( set /a sum+=1 rename "%%x" "!sum!.jpg" ) ) pause