::==================================================================================== :: This file will place all files into "Season" folders. :: Simply rename to CreateFolders.bat, copy to episodes folder, and run it. :: Do not modify the code below this line! ::==================================================================================== @ECHO OFF TITLE Create Archer Season Folders SET /P DELETESCRIPT=Do you wish to place all episodes in Season folders? Note that this action cannot be undone! (Y/N) IF /i %DELETESCRIPT%==y ( GOTO:CONFIRM ) IF /i %DELETESCRIPT%==yes ( GOTO:CONFIRM ) ECHO. ECHO No actions have been chosen. GOTO:END :CONFIRM SETLOCAL EnableDelayedExpansion ECHO Creating "Season" folders... ECHO. SET DOSTUFF="nope" FOR %%F IN (*.mp4) DO ( SET NAME=%%~nF SET PREFIX="!NAME:~0,2!" IF !PREFIX! == "00" ( IF NOT EXIST "%cd%\Extras" ( MD "%cd%\Extras" ) ECHO Moving !NAME! to "Extras". MOVE /y "%cd%\%%F" "%cd%\Extras" >nul ) IF !PREFIX! == "01" ( IF NOT EXIST "%cd%\Season 1" ( MD "%cd%\Season 1" ) ECHO Moving !NAME! to "Season 1". MOVE /y "%cd%\%%~F" "%cd%\Season 1" >nul ) IF !PREFIX! == "02" ( IF NOT EXIST "%cd%\Season 2" ( MD "%cd%\Season 2" ) ECHO Moving !NAME! to "Season 2". MOVE /y "%cd%\%%~F" "%cd%\Season 2" >nul ) IF !PREFIX! == "03" ( IF NOT EXIST "%cd%\Season 3" ( MD "%cd%\Season 3" ) ECHO Moving !NAME! to "Season 3". MOVE /y "%cd%\%%~F" "%cd%\Season 3" >nul ) IF !PREFIX! == "04" ( IF NOT EXIST "%cd%\Season 4" ( MD "%cd%\Season 4" ) ECHO Moving !NAME! to "Season 4". MOVE /y "%cd%\%%~F" "%cd%\Season 4" >nul ) IF !DOSTUFF! == "nope" ( SET DOSTUFF="yep" ) ) IF %DOSTUFF% == "yep" ( ENDLOCAL GOTO:FOUND ) ELSE ( ENDLOCAL GOTO:NONE ) :NONE ECHO Error! No episodes found. ECHO Move this batch into the directory with the episodes and rerun it. GOTO:END :FOUND ECHO. ECHO Press any key to close this window. PAUSE > nul DEL "%0" /F /Q >nul :END ECHO. ECHO Press any key to close this window. PAUSE > nul