I have some very complex variables and am trying to replace part of the long variable with a different variable.
SETLOCAL EnableDelayedExpansion
SET var1=Name=@something,also.something;else
SET var2=REPLACEMENT
SET var3="v2.30|Action-Maybe|Active=Possible|Name=@something,also.something;else|Microsoft.windows.programs://Microsoft.com|"
call set var3=%%var3:!var1!=!var2!%%
ECHO %var3%
However, when I do so, I get the following Output:
"v2.30|Action-Maybe|Active=Possible|@something,also.something;else=REPLACEMENT=@something,also.something;else|Microsoft.windows.programs://Microsoft.com|"
Note how Name= has disappeared from the beginning of the part of text I'm trying to replace.
Also note how the replacement variable is appearing twice (both times missing Name=).
I know the problem probably lies in the line:
call set var3=%%var3:!var1!=!var2!%%
But I'm unsure how to escape the '=' character contained in the replacement variable... Assuming that's what causing the problem, of course...