Re: How to include a double quote in an argument
- From: "David Wang [Msft]" <someone@xxxxxxxxxxxxxxxxxxxx>
- Date: Tue, 13 Dec 2005 02:27:17 -0800
Yeah, I've asked Eric Lippert about this before, and he told me after
looking through the command parser that double quotes are not preserved.
You have to write your own escape sequence for double quotes. I've been
using `` (two backquotes) myself.
--
//David
IIS
http://blogs.msdn.com/David.Wang
This posting is provided "AS IS" with no warranties, and confers no rights.
//
"Michael Harris (MVP)" <mikhar at mvps dot org> wrote in message
news:%23uwZnnU$FHA.3872@xxxxxxxxxxxxxxxxxxxxxxx
asa wrote:
> I'm trying to pass a named argument that includes spaces and double
> quotes in the argument itself in a wsf script. Since the argument
> contains spaces, I have to enclose it in double quotes. I tried
> doubling up the double quotes, but it didn't work.
>
> I tried this:
> "echo ""wc -l F9999.txt > F999audit.txt "" "
>
> The argument was stripped of all quotes when assigned to a variable:
> sCommandTxt = colNamedArgs.Item("C")
> How do I keep the quotes?
Not posible - w/cscript host parsing of script arguments and population of
the Arguments (or .Named or .Unnamed) collections does not preserve the
enclosing quotes and no syntax for escaping them when passed is supported,
--
Michael Harris
Microsoft MVP Scripting
.
- References:
- Re: How to include a double quote in an argument
- From: Michael Harris \(MVP\)
- Re: How to include a double quote in an argument
- Prev by Date: Re: Copying folder with criteria usign FSO?
- Next by Date: Re: Copying folder with criteria usign FSO?
- Previous by thread: Re: How to include a double quote in an argument
- Next by thread: Reboot to Command Prompt?
- Index(es):
Relevant Pages
|