Invoke VBScript: No paths with whitespaces possible

Seems like ‘invoke VBscipt’ cannot work with paths that have whitespaces in it. It is also not possible to mask the whitespaces with double quotes because the internal errorhandling of the activity will throw in this case.
Any workarounds? Changing the paths name is not a valid workaround…

2 Likes

This should be reported as a bug. It simply doesn’t work if the path to your vbs-file contains any spaces whether it resides in your project folder or outside.

I have also figured out that the activity has the same problem with the vbs arguments. The arguments must be string. The script will only receive the part before the whitespace.

Yeah lets give it a try. I think that strings should be masked to be suitable for the scripthost.

For arguments with spaces you need to include quotes around them. You can do this in UiPath for example:

“”“argument”“”

But it doesn’t work if there is a space in the path to the vb script itself. This seems like a bug in UiPath software.

2 Likes

is any other Way to fix this.

I ahve two Input files:
D:/Project folder1/FIle Name1.xlsx
D:/Project folder1/FIle Name2.xlsx

When Vbscript readin this file it is getting like breaking the file name with (,) as shown below.

D:/Project folder1/**FIle , Name.**xlsx
not even taking all the parameters.

please somebody assist us to fix this issue.

The issue in this thread is not about spaces in parameters. If you need spaces in your parameters, surround them with double quotes.

"""D:/Project folder1/FIle Name1.xlsx"""

or if you have it in a variable:

"""" + file1 + """"

image

2 Likes

For Arguments with whitespaces I try with Chr(34)+argument1+Chr(34) and works. But the ‘invoke VBscipt’ cannot work with paths that have whitespaces and I execute a separated VBscript without spaces with this commands:
Set objShell = CreateObject(“Wscript.Shell”)
objShell.Run chr(34) & “ScriptPathWithSpaces.vbs” & chr(34) & " " & chr(34) & “argument1” & chr(34) & " " & chr(34) & “argument2” & chr(34)

1 Like

Other solution is Writing the path in the executor, something like this:
image

1 Like

We can run VB Script file path contain whitespaces using “Start Process” Activity.

image

Thanks
Shiva

1 Like

That worked!

thanks a lot !!

:smile: