2 '--- start of vbslib include ------------------------------------------------------
\r
3 Dim g_debug, g_vbslib_path, g_IncludeType, g_CommandPrompt, g_fs, g_sh
\r
4 If IsEmpty( g_fs ) Then
\r
5 '--- start of parameters for vbslib include -------------------------------
\r
7 g_vbslib_path = "vbslib\vbs_inc.vbs"
\r
10 '--- end of parameters for vbslib include ---------------------------------
\r
11 Dim g_f, g_include_path, i : Set g_fs = CreateObject( "Scripting.FileSystemObject" )
\r
12 If g_fs.FileExists("setting.vbs") Then Set g_f = g_fs.OpenTextFile( "setting.vbs" ): Execute g_f.ReadAll()
\r
13 If not IsEmpty( WScript.Arguments.Named.Item("IncludeType") ) Then g_IncludeType = WScript.Arguments.Named.Item("IncludeType")
\r
14 Set g_sh = WScript.CreateObject("WScript.Shell") : g_f = g_sh.CurrentDirectory
\r
15 g_sh.CurrentDirectory = g_fs.GetParentFolderName( WScript.ScriptFullName )
\r
16 For i = 10 To 1 Step -1 : If g_fs.FileExists(g_vbslib_path) Then Exit For
\r
17 g_vbslib_path = "..\" + g_vbslib_path : Next
\r
18 If g_fs.FileExists(g_vbslib_path) Then g_vbslib_path = g_fs.GetAbsolutePathName( g_vbslib_path )
\r
19 g_sh.CurrentDirectory = g_f
\r
20 If i=0 Then WScript.Echo "Not found " + g_fs.GetFileName( g_vbslib_path ) +vbCR+vbLF+ "Check g_vbslib_path in " + WScript.ScriptName + " or setting.vbs" : WScript.Quit 1
\r
21 Set g_f = g_fs.OpenTextFile( g_vbslib_path ): Execute g_f.ReadAll() : g_f = Empty
\r
22 If ResumePush Then On Error Resume Next
\r
24 ResumePop : On Error GoTo 0
\r
26 '--- end of vbslib include --------------------------------------------------------
\r
29 '********************************************************************************
\r
31 '********************************************************************************
\r
34 g_Test.Debug "T_Fail_run.vbs", "test_main", ""
\r