(view source code of mdacver.vbs as plain text)
Option Explicit
If WSCript.Arguments.Named.Count > 0 Then Syntax
If WSCript.Arguments.UnNamed.Count > 1 Then Syntax
Dim intRC, objConn
intRC = 0
' Create a connection object
Set 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 met
If 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
Else
Syntax
End If
End If
' Display the (MDAC) version number
WScript.Echo objConn.Version
Set objConn = Nothing
' End the script, and return the result of the comparison
WScript.Quit intRC
Sub Syntax
Dim strMsg
strMsg = "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: 2024-04-16; loaded in 0.0085 seconds