Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

how to execute a VBScript file from a VB6 subroutine?

Status
Not open for further replies.

dgr7

IS-IT--Management
Dec 29, 2006
43
US
Hello,
I was wondering if anyone could share with me the VB6 code that would execute a VBScript file named
test.vbs
in the subdirectory
D:\test\
thanks in advance,
david
 
More information is needed to answer the question.

VBScript is not a stand-alone language. A file containing VBScript source code is usually meant to run in the context of a specific script host, though it is quite possible to write Subs, Functions, or Classes that can be used in many contexts.

Whole scripts though usually target CScript, WScript, IE, Office Suite applcations, or some other host (such as a specific VB6 program).


If this is a stand-alone WSH script you could Shell a copy of CScript (or WScript as appropriate) and pass it the .VBS file as a parameter. If the script is written for your default WSH host you can just Shell the script file name itself.


You might also want to read the classic article Exploring the Microsoft Script Control if you are trying to write a scriptable VB6 program.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top