Hello,
anyone could tell me, how do I properly pass arguments into Start Process activity?
I’m trying to start simple .vbs e.g.:
Dim title
x=msgbox(“B”,0, title)
And I want to pass title argument in UiPath in arguments box in activity. I’ve tried to pass string in quotation marks, with assigning “title=string”, nothing worked.
Where I am wrong? How to do it? I have to change something in the script?
Hi, is there a solution to this issue where vbs file is not accepting arguments passed via Start process activity in UIpath? Or do I need to specify something in vbs file to use this argument? I am facing this issue, please help.
My vbs code is starting as below (varDirectory is the variable to which this argument should be passed):
msgbox varDirectory
Call Func_Filter_Excel(varDirectory)
Public Function Func_Filter_Excel(ByVal sPath)
Set objExcel = CreateObject(“Excel.Application”)
Start Process starts an application, but .vbs file is a file, not an application. So, you need to open the .vbs file with an application (probably cscript.exe). Then, to use arguments place them next to the filename like you would if you were calling it a command prompt.
Also, the arguments field where the filename goes should be surrounded by embedded quotes (again, just like you would in command prompt)
Thanks for your quick inputs, but am still not sure how my vbs code will use these arguments. My arguments will again be string variables created in uipath, please guide me how to implement it.
I did a quick search and found this that might help:
It says WScript.Arguments(0) or WScript.Arguments.Item(0) can be used to access the arguments. You would need to use this in your vbscript.
You might want to test this with some script editor where you can pass arguments, or even call it from command line, like c:\windows\system32\cscript.exe "C:\folderpath\Program_Filter_Excel.vbs" "vikas"
Once it is set up to use arguments, then you can set up your Start Process as suggested.
Use ‘Invoke Code Activity’ and use the code in below format:
System.Diagnostics.Process.start(“{VBS File Path}{VBS File Name}.vbs”,Argument1 &" “& Argument2)