
How to make an include file in WSH ?
There are two ways. If you are using a .VBS file then you can use the
following function:
Function Include ( ByVal filename )
dim fso: set fso = CreateObject("Scripting.FileSystemObject")
Include = fso.FileExists(filename)
if Include then
dim tso: set tso = fso.OpenTextFile(filename)
ExecuteGlobal tso.ReadAll
tso.Close
end If
End Function
If you are using .WSF files then you add a line like the following to your
script header:
<script language="VBScript" src="\\ems-nt1\vbinclude\sort.vbs"/>
Note that you must substitute your fully qualified file and path name for
="\\ems-nt1\vbinclude\sort.vbs"
Quote:
> Is there a possibility to include a file in WSH just as in ASP programs
> ?
> It could be : include toto.wsh.
> Thanks.