More on MSXML sniffing

M

Following on from the VFP code for checking this in my last post, here’s a link to some code Scott converted for quickly checking a client’s machine for MSXML parser installs. (and Scott, you really should start a blog and begin pushing out your great ideas.)
It is a simple VB script file that will run on any machine with W2K or XP installed, ie you don’t need VFP installed.

I’ve pasted the code below (complete with really bad formatting) but forget that, instead you can download the complete file here:
www.svfpug.com.au/assets/xmlsniffer.vbs
(Just double-click the file to run it)

‘ VBS Msxml Sniffer Script
‘ Author SS 07-07-2004
‘ Converted from msxml_sniffer.asp

On Error Resume Next
Dim oXmlDim xml, xsl, msxml2reason, msxml2v26reason, msxml2v30reason, msxml2v40reason, msxmlreason, replacereason
xml = ““xsl = “http://www.w3.org/1999/XSL/Transform“” xmlns:m=””urn:schemas-microsoft-com:xslt””>
msxml2reason = “Installed”msxml2v26reason = “Installed”msxml2v30reason = “Installed”msxml2v40reason = “Installed”msxmlreason = “Installed”replacereason = “Side by Side”
‘ Check MSXML2Set oXml = CreateObject(“Msxml2.DOMDocument”)If Err.Number > 0 Then msxml2reason = Err.Description Err.ClearElse oXml.async = false oXml.loadXML(xml) If Err.Number > 0 Then msxml2reason = Err.Description Err.Clear End IfEnd If
‘ Check MSXML2 Version 2.6Set oXml = CreateObject(“Msxml2.DOMDocument.2.6”)If Err.Number > 0 Then msxml2v26reason = Err.Description Err.ClearElse oXml.async = false oXml.loadXML(xml) If Err.Number > 0 Then msxml2v26reason = Err.Description Err.Clear End IfEnd If
‘ Check MSXML2 Version 3.0Set oXml = CreateObject(“Msxml2.DOMDocument.3.0”)If Err.Number > 0 Then msxml2v30reason = Err.Description Err.ClearElse oXml.async = false oXml.loadXML(xml) If Err.Number > 0 Then msxml2v30reason = Err.Description Err.Clear End IfEnd If
‘ Check MSXML2 Version 4.0Set oXml = CreateObject(“Msxml2.DOMDocument.4.0”)If Err.Number > 0 Then msxml2v40reason = Err.Description Err.ClearElse oXml.async = false oXml.loadXML(xml) If Err.Number > 0 Then msxml2v40reason = Err.Description Err.Clear End IfEnd If
‘ Check Microsoft.XMLDOMSet oXml = CreateObject(“Microsoft.XMLDOM”)If Err.Number > 0 Then msxmlreason = Err.Description Err.ClearElse oXml.async = false oXml.loadXML(xml) If Err.Number > 0 Then msxmlreason = Err.Description Err.Clear End IfEnd If
‘ Check for replace modeIf msxmlreason = “Installed” Then Set oXsl = CreateObject(“Microsoft.XMLDOM”) oXsl.async = false oXsl.loadXML(xsl) cOutput = oXml.transformNode(oXsl) If Right(cOutput, 1) <> “>” Then replacereason = “Version ” & Right(cOutput, 1) End If Set oXsl = NothingEnd If
MsgBox “MSXML Versions Installed” & vbCrLf & vbCrLf & _ “Msxml2.DOMDocument: ” & msxml2reason & vbCrLf & _ “Msxml2.DOMDocument.2.6: ” & msxml2v26reason & vbCrLf & _ “Msxml2.DOMDocument.3.0: ” & msxml2v30reason & vbCrLf & _ “Msxml2.DOMDocument.4.0: ” & msxml2v40reason & vbCrLf & _ “Microsoft.XMLDOM: ” & msxmlreason &amp; vbCrLf & vbCrLf & _ “Replace Mode: ” & replacereason & vbCrLf
Set oXml = Nothing


2 comments

About Craig

I'm the co-host of HubShots and the CEO of XEN - helping mid-large B2B companies with their digital marketing and lead generation.

Craig Bailey

Archives

Posts

BERT