You can create an additional batch file, for example, "echoxml.bat". This will allow the use of the ~ notation to highlight quotes:
@echo off echo ^<root^>^<dir^>%~1^</dir^>^</root^>
and then use the batch file in the files:
%FF_CMD% /c "cmd /c if @isdir==TRUE echoxml.bat @fname"
EDIT: Another option is to change the forfiles to for or even for /d , if possible (I don't know what arguments you use in %FF_CMD% ):
@echo off for /d %%A in (*) do echo ^<root^>^<dir^>%%~A^</dir^>^</root^>
source share