1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49
|
...
Do While MyExit=0
Print_Log Log_File, "Launching VBS in 5 minutes !"
WScript.Sleep(300000)
'Vérification de la version du vbs local
LocalVbsFileVer=CheckLocalVer(LocalVbsFileName)
Print_Log Log_File, "Local HeartBeat File Version : " & LocalVbsFileVer
LocalVbsLibVer=CheckLocalVer(LocalVbsLibName)
Print_Log Log_File, "Local Library File Version : " & LocalVbsLibVer
LocalVbsMainVer=CheckLocalVer(LocalVbsMainName)
Print_Log Log_File, "Local Main File Version : " & LocalVbsMainVer
' Connexion à SQL Server.
Print_Log Log_File, "Connectiong to SQL ..."
Set oCn = WScript.CreateObject("ADODB.Connection")
oCn.ConnectionString = "Driver={SQL Server};" & _
"Server=monserver;" & _
"Address=monserver,1433;" & _
"Network=DBMSSOCN;" & _
"Database=mabase;" & _
"user id=monuser;" & _
"password=monpass;"
oCn.Open
If Err.number <> 0 Then
Print_Log Log_File, "Not Able To Connect to SQL Server !"
Print_Log Log_File, Err.Number & ":" & Err.Description
Set Err.number = 0
oCn.ConnectionString
Set oCn = Nothing
Else
Print_Log Log_File, "Connected to SQL Server !"
Print_Log Log_File, "Controlling files version ..."
ControlFileVer LocalVbsFileName,LocalVbsFileVer
ControlFileVer LocalVbsLibName,LocalVbsLibVer
ControlFileVer LocalVbsMainName,LocalVbsMainVer
Print_Log Log_File, vbtab & "Getting System Info..."
MyResult = split(ExecCommand("cscript.exe //H:CScript //nologo //T:60 " & LocalVbsFileName),vbcrlf)
Print_Log Log_File, vbtab & "Command Output :"
For each StrLine in MyResult
Print_Log Log_File, vbtab & vbtab & StrLine
Next
oCn.Close
Set oCn = Nothing
End If
Loop
... |
Partager