I have this script, which works:
FOR /F "delims=\" %%i IN ('dir /b /ad-h /o-d') DO (
SET a=%%i
GOTO :found
)
echo No subfolder found
goto :eof
:found
echo Most recent video created: &echo. & echo."%a%"
if /i "%a:~-3%"=="ESP" goto:next else goto:GBR
:GBR
if /i "%a:~-3%"=="GBR" goto:next else goto:SPE
:SPE
if /i "%a:~-3%"=="SPE" goto:next
cd %a%
for %%a in (*) do rename "%%a" "%%~na-%a%%%~xa"
cd ..\
ren "%a%" "%a% - GBR"
echo.
echo %a% video has been processed
echo.
pause
exit /b
:next
echo.
echo. %a% Video already processed
echo.
pause
:exit
exit /b
I have tried to get an IF ELSE
working however I cannot. I have had to use labels but it is not a clean way if I were to expand the search criteria.
Am I missing something?
This is what I tired, which does NOT work:
echo Most recent video created: &echo. & echo."%a%"
if /i "%a:~-3%"=="ESP" goto:next else
if /i "%a:~-3%"=="GBR" goto:next else
if /i "%a:~-3%"=="SPE" goto:next