Re: cmd.exe documentation
- From: "Larry" <larry_grant_dc@xxxxxxxxxxx>
- Date: 20 Dec 2005 07:00:09 -0800
> Why can't you "do"
>
> myCommand "Hi there "dude"!"
>
> It works perfectly well for me.
>
> The parser appears to do this: (with quotes)
> If the first character of a token is a double-quote, then the token consists
> of all characters from that opening-quote up to the next double-quote that
> is either at end-of-line or is followed by a separator (space or comma - I
> haven't tested any others) - including the quotes.
>
> %~n (where n is a parameter token-number, 1 to 9) will remove the enclosing
> quotes ONLY.
>
> Depending on how you are processing a token, certain characters may need to
> be escaped with a prefixed caret (^)
>
> HTH
In my tests, if you do:
> myCmd "hi "there" dude"
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 (^):
> myProg "hi ^"there^" dude"
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: '\''
.
- Follow-Ups:
- Re: cmd.exe documentation
- From: billious
- Re: cmd.exe documentation
- References:
- cmd.exe documentation
- From: Larry
- Re: cmd.exe documentation
- From: billious
- Re: cmd.exe documentation
- From: Larry
- Re: cmd.exe documentation
- From: billious
- cmd.exe documentation
- Prev by Date: Re: How to clear the Recently used file list
- Next by Date: Re: Making a backup copy of WinXP or replacing a lost/damaged disk.
- Previous by thread: Re: cmd.exe documentation
- Next by thread: Re: cmd.exe documentation
- Index(es):
Relevant Pages
|
Loading