(view source code of mdacver.vbs as plain text)
Option ExplicitIf WSCript.Arguments.Named.Count > 0 Then Syntax
If WSCript.Arguments.UnNamed.Count > 1 Then Syntax
Dim intRC, objConnintRC = 0
' Create a connection objectSet objConn = CreateObject( "ADODB.Connection" )
' If a minimum required version was specified, compare it to' the actual version and return a non-zero return code if the' required minimum wasn't metIf WSCript.Arguments.UnNamed.Count = 1 Then
If IsNumeric( WSCript.Arguments.UnNamed(0) ) Then
If objConn.Version < WSCript.Arguments.UnNamed(0) Then
intRC = 1
End If
ElseSyntax
End If
End If
' Display the (MDAC) version numberWScript.Echo objConn.Version
Set objConn = Nothing
' End the script, and return the result of the comparisonWScript.Quit intRC
Sub Syntax Dim strMsgstrMsg = "MDACVer.vbs, Version 1.00" _
& vbCrLf _& "Check the installed MDAC version, and optionally compare it to a" _
& vbCrLf _& "specified minimum required version number" _
& vbCrLf & vbCrLf _
& "Usage: CSCRIPT.EXE //NoLogo mdacver.vbs [ min_req ]" _
& vbCrLf & vbCrLf _
& "Where: ""min_req"" is the minimum required version; the script will" _
& vbCrLf _& " return a return code 1 if the actual MDAC version" _
& vbCrLf _& " is older than the minimum specified, or 0 if it is" _
& vbCrLf _& " equal or newer or if no minimum was specified." _
& vbCrLf & vbCrLf _
& "Written by Rob van der Woude" _
& vbCrLf _& "http://www.robvanderwoude.com"
WScript.Echo strMsg
WScript.Quit 1
End Sub
page last modified: 2025-10-11; loaded in 0.0094 seconds