2011-05-16, 13:27
I`m trying to create a small batch script to rename the backdrops.jpg saved by Media Center Master as local metadata to an extrathumbs folder, with each jpg renamed to thumb1,thumb2 etc. I got most of it working with one small issue. When remaming the "backdrop.jpg" it outputs "thumbrop.jpg" instead of "thumb.jpg". I did a little research and it seems the "ren" (rename) command bat only renames as much caracters as the new name, and continues to put the rest of the left letters in the new name ouput.
Any ideeas on how to directly rename "backdrop.jpg" to thumb.jpg or to re-rename the resulting "thumbrop.jpg" to "thumb.jpg" ? Here is the script code, btw
Any ideeas on how to directly rename "backdrop.jpg" to thumb.jpg or to re-rename the resulting "thumbrop.jpg" to "thumb.jpg" ? Here is the script code, btw
Code:
--- begin script ---
m:
cd D:\Movies
for /f "tokens=1*" %%A in ('dir /b *') do call:ENTER %%A %%B
goto:EOF
:ENTER
set folder=%*
@echo Working in folder %folder%
if not exist "D:\Movies\%folder%\extrathumbs" mkdir "D:\Movies\%folder%\extrathumbs"
@echo ...moving backdrops*
move "D:\Movies\%folder%\backdrop*.jpg" "D:\Movies\%folder%\extrathumbs\
cd D:\Movies\%folder%\extrathumbs\
ren "backdrop*.jpg" "thumb*.jpg"
goto:EOF
--- end script ---