Hi,
I have the following script that will go thru a folder containing several xml files and then extract data from those XML files. However, I want it to *only* parse XML files that begin with the letters BEX. How can I make this happen? Below is the script.
TIA
I have the following script that will go thru a folder containing several xml files and then extract data from those XML files. However, I want it to *only* parse XML files that begin with the letters BEX. How can I make this happen? Below is the script.
TIA
Code:
Dim server, filepath
Dim fso,fold,fil,XMLDoc
Set fso = CreateObject("Scripting.FileSystemObject")
Set fold = fso.GetFolder("C:\Program Files\Symantec\Backup Exec\Data")
For each fil in fold.files
if DateDiff("d",Now,fil.DateCreated) = 2 Then
Set xmlDoc = CreateObject("Msxml2.DOMDocument")
fil = fold & "\" & fil.name
xmlDoc.load(fil)
Set ElemList = xmlDoc.getElementsByTagName("jobServer")
server = ElemList.item(0).Text
Wscript.Echo server
Set ElemList = xmlDoc.getElementsByTagName("timeStart")
start_time = Replace(ElemList.item(0).Text,"Job started:","")
Wscript.Echo start_time
Set ElemList = xmlDoc.getElementsByTagName("timeEnd")
end_time = Replace(ElemList.item(0).Text,"Job ended:","")
Wscript.Echo end_time
Set ElemList = xmlDoc.getElementsByTagName("completeStatus")
engine_completion_status = Replace(ElemList.item(0).Text,"Job completion status:","")
Wscript.Echo engine_completion_status
End if
Next