tags:

views:

30

answers:

2

Hi I have for example two VB script:

Test1.vb Test2.vb

How to run Test2.vb from Test1.vb

Test2.vb location : C:\Program Files

A: 

Run the script from WScript.shell object.

buckbova
+2  A: 

I think this would work:

Dim obj
Set obj = Wscript.CreateObject("WScript.Shell")
obj.Run "C:\Program Files\Test2.vbs"
ho1
another quastionif Test2.vbs ended then he return to Test1.vbs?yael
yael
@yael: Yes, after Test2 has finished execution should go back to Test1.
ho1
will line #3 wait until `Test2.vbs` finishes executing before proceeding to line #4?
JohnB
@JohnB: Depends on the 3rd (optional) parameter. By default it won't wait, but if you set the 3rd parameter to `true` it will. See here for details: http://msdn.microsoft.com/en-us/library/d5fk67ky%28VS.85%29.aspx
ho1