Skip to content

Instantly share code, notes, and snippets.

@abarnas
Created October 11, 2011 17:35
Show Gist options
  • Save abarnas/1278782 to your computer and use it in GitHub Desktop.
Save abarnas/1278782 to your computer and use it in GitHub Desktop.
Using VBScript Include Files
Sub Include(strFilename)
On Error Resume Next
Dim oFSO, f, s
Set oFSO = CreateObject("Scripting.FileSystemObject")
If oFSO.FileExists(strFilename) Then
Set f = oFSO.OpenTextFile(strFilename)
s = f.ReadAll
f.Close
ExecuteGlobal s
End If
Set oFSO = Nothing
Set f = Nothing
On Error Goto 0
End Sub
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment