In DOS/Windows, how can I use the % character on the command line, without referring to an environment variable?
By way of a contrived example, say I run the following in a command prompt:
This is all perfectly valid. However, any future reference to TEST%ENV%FILE would now be TESTZZZZFILE, which, obviously, doesn't exist. I still want to reference the real file, and I want to do so without removing the ENV variable - even temporarily. Is this possible?
PS - My Google-fu is not strong at 4.15am. I've spent the last 30 minutes trying to find a solution.
Solved - double up the percent signs.
By way of a contrived example, say I run the following in a command prompt:
Code:
echo > TEST%ENV%FILE
set ENV=ZZZZ
This is all perfectly valid. However, any future reference to TEST%ENV%FILE would now be TESTZZZZFILE, which, obviously, doesn't exist. I still want to reference the real file, and I want to do so without removing the ENV variable - even temporarily. Is this possible?
PS - My Google-fu is not strong at 4.15am. I've spent the last 30 minutes trying to find a solution.
Solved - double up the percent signs.
Last edited: