Skip to content

Instantly share code, notes, and snippets.

@Citillara
Created April 25, 2018 13:15
Show Gist options
  • Save Citillara/54464c9d67c097fdb4f321172fa6bfd7 to your computer and use it in GitHub Desktop.
Save Citillara/54464c9d67c097fdb4f321172fa6bfd7 to your computer and use it in GitHub Desktop.
if WScript.Arguments.Count = 0 then
WScript.Echo "Missing parameters"
else
Set xmlDoc = _
CreateObject("Microsoft.XMLDOM")
xmlDoc.Async = "False"
xmlDoc.Load(WScript.Arguments(0))
Select Case xmlDoc.parseError.errorCode
Case 0
WScript.Echo "Valid"
Case Else
WScript.Echo "ERROR! Failed to validate" &_
WScript.Arguments(0) & vbCrLf & xmlDoc.parseError.reason & vbCr & _
"Error code: " & xmlDoc.parseError.errorCode & ", Line: " & _
xmlDoc.parseError.line & ", Character: " & _
xmlDoc.parseError.linepos & ", Source: " & _
Chr(34) & xmlDoc.parseError.srcText & _
Chr(34) & " - " & Now & vbCrLf
End Select
end if
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment