Creating script to process RC for multiple folders in sequence

Hi,
as I wrote you before, the script wasn’t refined.
It should work like this (this one was tested):

:: root path to work folders where all the datasets are stored (%~dp0 means the folder in which this script is stored)
set RootFolder=%~dp0

:: path to RealityCapture application
set RealityCaptureExe="C:\Program Files\Capturing Reality\RealityCapture\RealityCapture.exe"

::Create loop on which to run RC for all subfolders
:: for /R %%f in (%RootFolder%\..) do >>runscriptrealitycapture

for /D %%f in ("%RootFolder%*") do (
        ::echo Processing folder: '%%f'^

        :: run RealityCapture
        %RealityCaptureExe% ^
                -newScene ^
                -addFolder "%%f\Images" ^
                -detectMarkers ^
				-importGroundControlPoints "%%f\Settings\DetectPositions.txt" ^ 
				-align ^
				-save "%%f\Project\Project.rcproj" ^
                -selectMaximalComponent "%%f\Project\Project.rcproj" ^
                -setReconstructionRegion "%%f\Settings\forCutFACS.rcbox" ^ 
				-calculateHighModel ^
				-save ^
				-selectLargestModelComponent ^
				-invertTrianglesSelection ^
				-removeSelectedTriangles ^
				-renameSelectedModel "Unedited" ^
				-exportSelectedModel "%%f\Outputs\Harlander_Unedited.obj" ^
				-save ^
                -quit
)

But it is possible that in attached script are unnecessary spaces, so you will need check for that.