
Arguments : Passing Arguments containing <">
Because of the way that WScript/CSript parse the command line, I've never found a way to pass a " as part of an argument. There is a way to cheat, though - use 2 single quotes to represent one double quote and use the replace function on each argument...
set args = wscript.arguments
Redim myArgs(args.count-1)
for n = 0 to args.count-1
'replace doubled single quotes with
'a single double quote...
myArgs(n) = replace(args(n),"''","""")
next
for each arg in myArgs
msgbox arg
next
--
Michael Harris
I Need to pass an Argument containing chr(34) " to a Vbscript like:
xpto(123)"abc
If I use W95 I can escape the Chr(34) using \ like xpto(123)\"abc and
it works fine
but if I use WNT4 it sould work with ^ for escape like xpto(123)^"abc
but it doesn't work.
I'm Reading the args through WScript.Arguments.Item(1)
Any Ideas Why? and workarounds ?
I'm using Vbscript 5.0 Build 3715
s1="Your script engine version is " & scriptengine & vbcrlf
s1=s1 & "Your script engine major version is " &
scriptenginemajorversion & vbcrlf
s1=s1 & "Your script engine minor version is " &
scriptengineminorversion & vbcrlf
s1=s1 & "Your script engine build version is " &
scriptenginebuildversion & vbcrlf
msgbox(s1)