|
'===================================================
' Import Code
'http://gazeek.com/coding/importing-vbs-files-in-your-vbscript-project/
'
'Usage:
'
' Import "Library.vbs"
'
'===================================================
Sub Import(strFile)
set WshShell = WScript.CreateObject("WScript.Shell")
Set objFs = CreateObject("Scripting.FileSystemObject")
strFile = WshShell.ExpandEnvironmentStrings(strFile)
strFile = objFs.GetAbsolutePathName(strFile)
Set objFile = objFs.OpenTextFile(strFile)
strCode = objFile.ReadAll
objFile.Close
ExecuteGlobal strCode
End Sub |
|