Friday, 16 January 2015

VBSCript to check if file exist and update scom

VBSCript to check if file exist and update scom



Dim oAPI, oBag
Set oAPI = CreateObject("MOM.ScriptAPI")
Set oBag = oAPI.CreatePropertyBag()
Set objFSO = CreateObject("Scripting.FileSystemObject")
strFile = "C:\MYFILE.LOG"
If objFSO.FileExists(strFile) Then
Call oBag.AddValue("Status", "OK")
Else
Call oBag.AddValue("Status", "Error")
Call oAPI.Return(oBag)
End If

No comments:

Post a Comment