@echo off

cd /d "%~dp0"

set input=%~nx1

:loop

If Exist "%input%" "_exe\PyLibs\python.exe" "_exe\Decompiler\ED6FCScenarioScript.py" --cp=ms932 --gp=.\_exe\game_files\DIR_FC "%~dp0%input%"

for %%f IN ("%~dp0%input%\*.py") DO (
If Not Exist "%~dp0%input%_py" mkdir "%~dp0%input%_py"
If Not Exist "%~dp0%input%_SN" mkdir "%~dp0%input%_SN"
move /y "%%f" "%~dp0%input%_py\.">nul
move /y "%~dp0%input%\%%~nf._SN" "%~dp0%input%_SN\.">nul
)

for %%f IN ("%~dp0%input%\*._SN") DO (
If Not Exist "%~dp0%input%_SNerror" mkdir "%~dp0%input%_SNerror">nul
move "%%f" "%~dp0%input%_SNerror\."
goto loop
)

pause
