I have this code with works great if the .bat is located in the same folder as the files. Code came from: .bat for batch rename to increment numbers in fname
@echo off
setlocal enabledelayedexpansion
set /a count=0
for /f "tokens=*" %%a in ('dir /b /od *.cbr') do (
echo ren "%%a" !count!.cbr
set /a count+=1
)
I would like to specificity a directory where the above process can take place.
This is my code but I cannot get it to work.
%NewFolder% - it is specified in the code above this part.
setlocal enabledelayedexpansion
set /a count=0
for /f "tokens=*" %%a in ('dir /b /od "004 - Images Ready\%NewFolder%\"*.JPG') do (
ren "004 - Images Ready\%NewFolder%\%%a" "004 - Images Ready\%NewFolder%\"!count!.JPG
set /a count+=1
)