for /f "usebackq delims=|" %%f in (`dir /b /a:-d "%~dp0"`) do (
set "_ext="
if /I %%~xf == .dat set _ext=1
if /I %%~xf == .ini set _ext=1
if defined _ext l2encdec -e413 %%f "%~dp0enc\%%f"
)
yeah most probably, this is the version that accepts only DATs and INIs, u can expand it to more extensions simpy by adding more ifs