Created
October 11, 2011 17:35
-
-
Save abarnas/1278782 to your computer and use it in GitHub Desktop.
Using VBScript Include Files
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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