Re: How to include a double quote in an argument

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


Relevant Pages

  • Applescript and Autoformat (search and replace), Word 2004
    ... script that will take care of a recurring editing issue with nested ... quotes to double quotes, ... set oldauto2 to auto format as you type replace quotes ... set auto format as you type replace quotes to false ...
  • Re: Accessing full command line or parameters WITH QUOTES
    ... The problem is that VBScript doesn't allow access to the full command line ... rebuild the parameters with the quotes inserted properly. ... When I was writing the script on XP, I managed to cheat and grab the ...
  • Re: Database/Email Script
    ... Both double and single quotes work for quoting array indexes. ... the relevant code. ... What I would like first would be to get the script working. ... task as a learning experience.) ...
  • Re: Interesting Discussion with my PHP Teacher
    ... ## For a small script like this one, ... > it wher the sql statement is constructed because there are too many quotes. ...
  • Re: basic help to run an application from WSH
    ... string values must be enclosed in quotes. ... The Run method will execute on c:\notepad.exe. ... I'm just learning vbscript for wsh and here is my first script, ... Also if I cut and paste the exact file path from the script into the ...