How to make an include file in WSH ?
Author Message
How to make an include file in WSH ?

Is there a possibility to include a file in WSH just as in ASP programs
?
It could be : include toto.wsh.

Thanks.

Sat, 20 Jul 2002 03:00:00 GMT
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)
tso.Close
end If

End Function

If you are using .WSF files then you add a line like the following to your

<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.

Sat, 20 Jul 2002 03:00:00 GMT

 Page 1 of 1 [ 2 post ]

Relevant Pages