I have a large number of files in subfolders under a parent folder called C:\Images.
All files have a prefix pattern of exactly the same length, 3 characters, i.e. "[digit][digit]-"
01-filename.jpg
55-filename.jpg
82-filename.jpg
I have worked out how to strip the prefix from filenames by running a batch file in each subfolder, but I want to run one batch files that will start at the parent folder and recursively step through each subfolder and rename / strip the prefix off each filename.
The code below doesn't work :-( any help would be great :-)
setlocal enabledelayedexpansion
for /r "c:\images\" %%f in (*.jpg) do (
pushd
set filename=%%f
set filename=!filename:~3!
rename "%%f" "!filename!"
popd
)