Never been to DZone Snippets before?

Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

About this user

« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS 

vbscript include function

This is a vbscript include function, useful for reusing files in a file library. Honestly, I don't remember where I found this, so if you know, post the attribution in a comment, please.
' VBScript "Include" routine
Sub Include(sInstFile)
	On Error Resume Next

	Dim oFSO, f, s

	Set oFSO = CreateObject("Scripting.FileSystemObject")
	If oFSO.FileExists(sInstFile) Then
		Set f = oFSO.OpenTextFile(sInstFile)
		s = f.ReadAll
		f.Close
		ExecuteGlobal s
	End If

	Set oFSO = Nothing
	Set f = Nothing
End Sub
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS