In a batchscript I am trying to capture a string containing multiple special characters
< , > , "Text" , = , / , \ , etc.
in a variable but I was unable to get it working using different escape characters
\ , "" , ^ , etc.
in different configurations, either single enclosing, escaping each special character separately, escaping string parts without success.
EDIT: As per Squashmans comment I tried using the enableddelayedexpansion but that did not resolve the issue
Example:
setlocal enabledelayedexpansion
set "var=<ExampleString Id="63fc47e6-fafb-48f92-bd92-38ed9aa4a765" Name="The Name of this item." AnotherItem="Name of this item." AnotherID="AAA-123" Action="GO"><ItemOne><Item Id="*"/></ItemOne><ItemTwo><Location1 Path="Mydrive\Folder1\*"/><Locaton2 Path="C:\Program Files (x86)\*"/></ItemTwo></ExampleString>"
ECHO %var%
It still returns the error:
< was unexpected at this time.