@echo off setlocal enabledelayedexpansion rem Get the path of the script set "scriptPath=%~dp0" rem Set the relative paths from the script location set "parserPath=%scriptPath%\net6.0-windows\PD2ModelParser.exe" set "sourceFolder=%scriptPath%\units" set "exportCommand=--export=" set "loadCommand=--load=" echo Parsing .model files in %sourceFolder% and its subdirectories... rem Check if the 'units' folder exists, if not, create it if not exist "%sourceFolder%" ( mkdir "%sourceFolder%" echo Created folder: %sourceFolder% ) for /R "%sourceFolder%" %%F in (*.model) do ( set "loadValue=%%F" set "exportValue=!loadValue:.model=.gltf!" echo Processing: !loadValue! echo Exporting to: !exportValue! "%parserPath%" %loadCommand%!loadValue! %exportCommand%!exportValue! ) echo Processing complete. endlocal