'************************************
'函数功能:加载外部VBS
'输入参数:
' 外部VBS文件路径
'返回值:
' 无
'*************************************
sub Include(sInstFile)
'On Error Resume Next
Dim oFSO, f, s
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set f = oFSO.OpenTextFile(sInstFile)
s = f.ReadAll
f.Close
ExecuteGlobal s
If Err.Number<>0 Then
MsgBox Err.Description
Err.Clear
End If
End Sub
或者使用 ExecuteFile 函数 ,如 : ExecuteFile("f:\txt.vbs")
'函数功能:加载外部VBS
'输入参数:
' 外部VBS文件路径
'返回值:
' 无
'*************************************
sub Include(sInstFile)
'On Error Resume Next
Dim oFSO, f, s
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set f = oFSO.OpenTextFile(sInstFile)
s = f.ReadAll
f.Close
ExecuteGlobal s
If Err.Number<>0 Then
MsgBox Err.Description
Err.Clear
End If
End Sub
或者使用 ExecuteFile 函数 ,如 : ExecuteFile("f:\txt.vbs")