I have a variable that contains ampersands and I need to create another variable that contains the first one. I know the "&" character can be escaped with carret (^) but I have no idea how to escape the text inside a variable.
set Name1 = Red ^& Green
set Name2 = %Name1% ^& Blue
'Green' is not recognized as an internal or external command, operable program or batch file.
I can't even "echo" the variables containing ampersands - I get the same error.
I need to use the variables in order to type their contents to the output or to manipulate files named by the variables like
type "%Name1%.txt"
type "%Name2%.txt"