Invoke VBScript bug

Hi Team,

When trying to use Invoke vbScript activity and passing a string and input arguments. There arguments passed are not taken as one argument each…but if we have a space separated string in the argument each word is taken as one argument which is not expected. This has been testing in version 22.4 and the latest as well on community the behavior is same. Sample code below and the input arguments and the output

sample vb script:

MsgBox WScript.Arguments(0), vbInformation
MsgBox WScript.Arguments(1), vbInformation

Input Arguments:

Expected output to be First message box with First Argument and Second with Second Argument

Unexpected output:
image
image

cheers

@Anil_G,

Try something like this in your vbscript

WScript.Arguments.Item(0)

@sarathi125

Thanks for that. The outcome remained same even with this

If there are any other things that you might feel cna work…you can try the script given above or can let me know I can try…else feel free to vote up

cheers

@Anil_G,

Checked it, the below format is working for me.

image

@sarathi125

Yes I know this is working…but it is not the right way…

cheers

The problem is not with reading the command line parameters, using double-quotes is the correct way to pass in a parameter that contains spaces.

@sarathi125

the aim of declaring an argument as string is to give each sentence as separate argument to script…the double quotes that we already provide to make it a string are to be escaped …as they are not being escaped we had to manually include few more double quotes in it

cheers