How I include vbs files ? 
Author Message
 How I include vbs files ?

Hi,

I have VBScript file (.vbs) and it seems to be quite large. How I can put
some subs in another vbs file and call then from the main.vbs file ?

For example I have main.vbs, first.vbs, second.vbs. First.vbs includes sub
called sub first1() etc.

So I like to call that first1() sub from main file how I do that.

-Jukka



Tue, 27 Aug 2002 03:00:00 GMT  
 How I include vbs files ?
There are 2 fairly standard solutions...

1) use .wsf file format...

<job>
<script language="vbscript" src="first.vbs" />
<script language="vbscript" src="second.vbs" />
...
<script language="vbscript">
...
...main vbscript code
...
</script
/job>

2) create WSCs to contain the common code which is then exposes a methods of a COM component.  A
common convention is for the progid to match the file name (mostly because the Wizard uses that
convention) but it's NOT a requirement...

In main./vbs...

set first = createobject("first.wsc")
set second = createobject("second.wsc")
...
..
.
first.MySub arg1,arg2,...
result = second.MyFunction(arg1,arg2,...)
.
..
...

--
Michael Harris
MVP Scripting

Hi,

I have VBScript file (.vbs) and it seems to be quite large. How I can put
some subs in another vbs file and call then from the main.vbs file ?

For example I have main.vbs, first.vbs, second.vbs. First.vbs includes sub
called sub first1() etc.

So I like to call that first1() sub from main file how I do that.

-Jukka



Tue, 27 Aug 2002 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. How to include vbs files

2. How to include vbs files

3. Include another VBS script file in a main VBS script

4. include files and/or parameters betw vbs-files

5. INCLUDE file in .VBS file?

6. ASP 2 VBS, include file problme

7. vbs include files

8. Include File in VBS

9. How to include other VBS files

10. Include .vbs file from another

11. including other VBS file?

12. Including vbs files?

 

 
Powered by phpBB® Forum Software