Execute the following 3 statements and see the result.
set myvar=11?22*33
echo %myvar:?=_%
echo %myvar:*=_%
On Win7/10, The second one replaces a question mark with an underscore, great.
But the third one fails with =_% was unexpected at this time.
So, I'd like to ask:
- What is the special meaning of
*
here? - How to have batch statement replace
*
with underscore?
==== Update ====
Well, this has been asked by someone and got answers: I need to match or replace an asterisk * in a batch environmental variable using only native Windows commands. Is this possible?