I'm making a utility using QuickTest Professional which calls a batch file with some parameters.
This batch file further calls a vbscript and passes some parameters to this vbs file.
This vbs file perform operations and generate a number.
I want this number to flow back from vbs to batch and then to QTP.
This is what I've figured out so far:
QTP(sending parameters to bat) >> Batch(sending parameters to vbs) >> VBS (generates a number)
now I want this vbs to return the output number back
VBS >> Batch(same bat which called vbs file) >> QTP(same qtp process which called this batch)
Here is my code:
QTP: (calling batch)
Dim BatchRun
Set BatchRun = CreateObject ("WSCript.shell")
invokefile= Chr(34) + "C:/invokebugz.bat" + Chr(34)
BatchRun.Run invokebugzfile & lob & " " & mailto & " " & mailcc & " " & title & " " & subject
Bat: (calling vbs)
cd C:\
cscript abc.vbs "%~1" "%~2" "%~3" "%~4" "%~5"
vbs:
Set args = Wscript.Arguments ' to accept command line arguments
xprod = args(0)
mailto = args(1)
mailcc = args(2)
xtitle = args(3)
xcomment = args(4)