I need to generate an xml from windows command prompt using the forfiles command.
I’m not so far, but the variable contains quotes and i don’t want it …
Here my current command:
%FF_CMD% /c "cmd /c if @isdir==TRUE echo ^<root^>^<dir^>@fname^</dir^>^</root^>"
the result is:
<root><dir>"DIRNAME"</dir></root>
but i want this:
<root><dir>DIRNAME</dir></root>
any idea ?
thanks in advance
You can create additional batch file, say “echoxml.bat”. This will allow to use
~notation to strip quotes:and then use the batch file in forfiles:
EDIT:
Another option would be to change
forfilestofor, or evenfor /dif it is possible (I do not know what arguments you use in%FF_CMD%):