I have a folder with picture files. Filename structure is ddmmyy2222.png where dd=day, mm=month and yy=year. I'm trying to rename them according to the structure yyyymmdd.png like this:
120516222.png => 20160512.png
010616222.png => 20160601.png
190316222.png => 20160316.png
%'s and " 's are driving me crazy. My last attempt is :
FOR /F %%n IN ('dir /b ') DO (
set "oldfile=%%n"
set "d=%oldfile:~0,2%"
set "m=%oldfile:~2,2%"
set "y=%oldfile:~4,2%"
set "newfile=20%y%%m%%d%"
echo.%newfile%
)
But I could not even reach RENAME statement as I did not get what I need in ECHO. What's wrong? Many thanks!
cmd
sounds like a world of hurt. Might be time to learn some powershell scripting if the apps won't work for you.