Larry said:
In my tests, if you do:
the parameter comes in as:
hi there dude
I would want it to be:
hi "there" dude
I tried escpaing the quotes with a caret (^):
and I got:
hi ^there dude
It almost looks like the caret actually does nothing special at all,
but then the second one is inexplicity lost.
What I'm really looking for is a way to take an arbitrary string (which
may have double-quotes, carets or other puntuation) and somehow pass it
into a program as a single parameter. By way of comparison, in most
Unix shells you could enclose the whole string in single quotes ('),
after replacing any internal single quotes by the sequence: '\''
Using this highly-complex file:
@echo off
echo arg-1:%1(%~1)
echo arg-2:%1(%~2)
the response to
thatbat "hi "there" dude"
is
arg-1:"hi "there" dude"(hi "there" dude)
arg-2

)
Regrettably, Microsoft systems don't seem to follow common sense, and it's
more important that it gets done quick and cheap rather than doing the job.
Dealing with all posible user-input is next to impossible - even if you can
get your environment variables to accept the appropriate values, the parser
will interpret the special characters inconveniently.
Microsoft wants to get rid of DOS, and has recruited a flock of parrots who
will endlessly repeat "there is no DOS." Consequently, the emulation is made
deliberately hard to use and incompatible with the previous versions and
utilities are added, removed and implemented willy-nilly.
What you are intended to do is to pay Microsoft for a programming platform,
and continue shelling out for "upgrades" to overcome their changing
environment. You then write the program yourself, using "visual" methods,
maintaining it each OS release.
....Bill