Hello,
I'm busy with a vbscript and have several problems with it, for now i think dat VisualCron is th etool for it.
But the most of the script i can convert, only the check i do is the problem for me.
Function ReadLog(oPath, logfile, pattern)
Dim oFS, textFile, colMatches
Dim locFile, strMatch, strSearchString
YY = 0
QQ = 0
locFile = oPath & Logfile
Set oFS = createobject ("scripting.FileSystemObject")
Set textFile = oFS.OpenTextFile(LocFile, ForReading)
Set objRegEx = CreateObject("VBScript.RegExp")
objRegEx.Pattern = pattern
Do until YY = 1
Do Until textFile.AtEndOfStream
strSearchString = textFile.ReadLine
Set colMatches = objRegEx.Execute(strSearchString)
If colMatches.Count > 0 Then
For Each strMatch In colMatches
Write2Log EVENT_SUCCESS, " De logfile " & LocFile & " is met succes ingelezen en de service is klaar (ReadLog-Sub)"
YY = 1
Next
Else
YY = 0
QQ = QQ + 1
End If
If QQ = 500000 Then
Write2Log EVENT_ERROR, "De " & locFile & " is aanwezig, alleen is het process " & LocFile & " nog niet klaar, Script is afgebroken (ReadLog-Sub)"
eTO = Email1
eSubject = "Er is een fout in de " & LocFile & " , de verwerking is nog steeds niet klaar, Check het process, Script is afgebroken"
eTextBody = "De " & locFile & " op de server is niet aanwezig en het script is afgebroken. Controleer of StreamServe wel draait."
SendEmail
WScript.Quit
End If
Loop
Loop
Set oFS = Nothing
Set locFile = Nothing
Set textFile = Nothing
Set colMatches = Nothing
Set strMatch = Nothing
Set strSearchString = Nothing
End Function
The function of this piece of script is the following.
An application is creating a log file and in this file he is telling what he is doing en after completing certain tasks, there will be a line that is telling the application is ready. I'm searching for that line to go to the next step in the script.
On Windows 2016, the script give me problems with this check.
Now my question is, can this be converted to a task within VisualCron.