wscript_path = Replace(WScript.ScriptFullName, "\" & WScript.ScriptName, "") Remote_script_path = wscript_path & "\" & "remote_script.vbs" If include_file(Remote_script_path) Then If WScript.Arguments.Count = 1 Then Execute WScript.Arguments(0) Else MsgBox "Bad num parameter." End If Else MsgBox "File is not exist: " & Remote_script_path End If WScript.Quit Function include_file(file_name) include_file = False Set FSO = CreateObject("Scripting.FileSystemObject") If fso.FileExists(file_name) Then Set OTS = FSO.OpenTextFile(file_name, 1) promSTR = OTS.ReadAll OTS.Close Set OTS = Nothing If Len(promSTR) Then ExecuteGlobal promSTR include_file = True End If' End If Set FSO = Nothing End Function |