I've been trying to create a batch file to rename my files into:
"Foldername_01.jpg, Foldername_02.jpg, etc..."
but my output gets renames the first file as "%~dp00.jpg" and the rest returns an error of
"A duplicate file name exists, or the file cannot be found"
My code:
@echo off
set /a count = 0
for %%a in (*.jpg) do (
set /a count+=1
ren "%%a" "%%~dp0_%count%.jpg"
)
pause
I don't understand why the count variable is not adding 1 from every entry and that the file is being renamed as " %~dp0 + count + .ext" rather than its "folder name + count + .ext"