@echo off
echo.
echo Changing file number position in GoPro filenames
echo like this: GXXXYYYY*.* ^<-^> YYYYGXXX*.*
setlocal enabledelayedexpansion
echo.
for /f "delims= eol=:" %%f in ('dir /b /a-d G???????*.* ????G???*.*') do (
set filename=%%~nf
set firstfour=!filename:~0,4!
set secondfour=!filename:~4,4!
echo %%f ^> !secondfour!!firstfour!!filename:~8!%%~xf
ren %%f !secondfour!!firstfour!!filename:~8!%%~xf
)
echo.
echo Done.
pause