calling a vbscript from vb 
Author Message
 calling a vbscript from vb

Hi!

Can I call a VBScript from a vb aplication?
How can I do it?

Thanks



Wed, 19 Nov 2003 06:41:11 GMT  
 calling a vbscript from vb
Quote:
-----Original Message-----

Hi!

Can I call a vbscript from a vb aplication?
How can I do it?

Thanks

.
Why would you want to do that?????



Wed, 19 Nov 2003 18:30:45 GMT  
 calling a vbscript from vb
hi el Fer,

Use the "Shell" command.  Give it the scripting engine name and the script
name.

    RetVal = Shell("C:\WINDOWS\WSCRIPT.EXE myPath\myScript.vbs",
vbNormalFocus)

Note that vb will run the script async, there is no wait parameter.  If you
want to wait, the normal approach would be to retrieve the processID, and
then use "WaitForSingleObject".  But then, I have heard that there have been
problems with that.  You may have to set a flag in the script to indicate
that you are done.

As an alternative, you can do it "the Hard Way".  That is you can
incorporate the Microsoft "Script Control" into your program, and then run
your script from inside the script control.  While it may take you a couple
of months to figure out how to use the script control, it WILL give you
total control over running your script.

Allah Akbar, jw


Quote:
> Hi!

> Can I call a vbscript from a vb aplication?
> How can I do it?

> Thanks



Wed, 19 Nov 2003 23:07:47 GMT  
 calling a vbscript from vb
Use shell should be the most simple way, you can also ignore the
Wscript.exe in the command and let system use the default script engine.

Thanks,

Robin



Fri, 21 Nov 2003 21:03:00 GMT  
 calling a vbscript from vb
Please do not post same issue several times.

Thanks,

Robin



Fri, 21 Nov 2003 21:00:43 GMT  
 
 [ 5 post ] 

 Relevant Pages 

1. Calling a VBScript function from a host VB application

2. Type Mismatch Error calling VB COM component from VBScript

3. Empty Arrary when VBScript calls VB COM object.

4. Call to activex works in JavaScript, VB, not in VBScript

5. VBScript - Calling Word VB functions

6. Calling VB from VBScript

7. Calling a VB program using VBscript

8. ?Calling VBScript function in VB code

9. call a VBscript function from VB

10. Calling a VB Script Routine from VB

11. Calling one VB Script from another VB Script

12. Call VBSCRIPT from VB

 

 
Powered by phpBB® Forum Software