?
=?ISO-8859-1?Q?Allan_Bo_J=F8rgensen?=
Hi,
I'm using W2K SP4 and I'm trying to pass an argument to a program from a
batch-file, that runs in a command prompt with delayed expansion
activated (with /V). The problem is that I wish to have one of these
parameters contain an exclamation point, but I can not figure out how to
do this. I tried with a caret before it and with a double exclamation
point, since this would seem logical from how I understand that the
percent character is treated. It just seems to get "filtered away" no
matter what.
The weird thing is that I can do this directly from the command line
with no problems - it's just inside a batch file that it fails.
You can reproduce the problem simply by making a small bat-file (I'll
call it testset.bat) containing just @SET AA=a!b, and then running
testset & set AA
from the command line. When you use delayed expansion this gives AA=ab
as output, whereas not using delayed expansion gives AA=a!b as output.
I'd very much like to know how to make it give AA=a!b with delayed
expansion ON.
ANY idea would be welcome - thanks in advance,
Allan Bo Jørgensen
I'm using W2K SP4 and I'm trying to pass an argument to a program from a
batch-file, that runs in a command prompt with delayed expansion
activated (with /V). The problem is that I wish to have one of these
parameters contain an exclamation point, but I can not figure out how to
do this. I tried with a caret before it and with a double exclamation
point, since this would seem logical from how I understand that the
percent character is treated. It just seems to get "filtered away" no
matter what.
The weird thing is that I can do this directly from the command line
with no problems - it's just inside a batch file that it fails.
You can reproduce the problem simply by making a small bat-file (I'll
call it testset.bat) containing just @SET AA=a!b, and then running
testset & set AA
from the command line. When you use delayed expansion this gives AA=ab
as output, whereas not using delayed expansion gives AA=a!b as output.
I'd very much like to know how to make it give AA=a!b with delayed
expansion ON.
ANY idea would be welcome - thanks in advance,
Allan Bo Jørgensen