search & replace strings in environment variables

Tech Tip: Click here to run a free scan for Windows Errors and optimize PC performance



Hello,

how can an asterisks ("*") - or other special characters (e.g. =) be
replaced in environment variables?
The following sequence doesn't work because * is treated as a wildcard:

--
SET TestVar="Asterisks*should*be*replaced"
SET TestVar=%TestVar:*=_%
--

Kind regards,

Frank


.



Relevant Pages