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.
   1  
   2  ' VBScript "Include" routine
   3  Sub Include(sInstFile)
   4  	On Error Resume Next
   5  
   6  	Dim oFSO, f, s
   7  
   8  	Set oFSO = CreateObject("Scripting.FileSystemObject")
   9  	If oFSO.FileExists(sInstFile) Then
  10  		Set f = oFSO.OpenTextFile(sInstFile)
  11  		s = f.ReadAll
  12  		f.Close
  13  		ExecuteGlobal s
  14  	End If
  15  
  16  	Set oFSO = Nothing
  17  	Set f = Nothing
  18  End Sub
« Newer Snippets
Older Snippets »
Showing 1-1 of 1 total  RSS