@setlocal enableextensions enabledelayedexpansion
title Change Options
echo off
set pl=natives\STM\player\mod\f\
set atxt="%~dp0\options.txt"
for /f "delims=" %%a in ('dir /b %pl%') do set "cid=%%a"

:START
cls
cd %pl%%cid%\options\  >nul 2>nul
echo Available options:
echo:

:: lists all available options and export into text
dir /b|find /n /v "" > %atxt%
echo =================================
dir /b|find /n /v ""
echo. 
echo [e] exit
echo.
echo =================================
echo.
echo. MAKE SURE TO RE-ENABLE THE MOD IN FLUFFY AFTER CHANGING MESH OPTIONS
echo. -GHNXXIV
echo.
echo =================================
echo.
set /p sel=Choose option:
if %sel% == e del %atxt% & exit


:: finds selected string from text file and removes brackets
cls
for /F "delims=" %%b in ('findstr /b /l "[%sel%]" %atxt%') do set op1=%%b
set ops=%op1:*]=%
echo %ops% selected
del %atxt%
::copies selected options folder contents into main mod folder
echo. 
xcopy /Y /S /E /C "%cd%\%ops%\*.*" "%~dp0\%pl%%cid%\"
echo.
echo =================================
echo.
echo. [%sel%] %ops% Enabled
echo.
echo =================================
echo.
echo. RE-ENABLE THE MOD IN FLUFFY OR IT WILL NOT WORK.
echo.
echo =================================

timeout 5
goto start