Detect .net version using BGInfo... RRS feed

  • Question

  • I have been searching for a week now. Found a script I know is close but won't give me any output in BGInfo...

    Anybody's input would be greatly appreciated...

    Function MaxFrameworkVersionCheck()

    Dim strComputer, objWMIService, colItems, strVar, objItem, maxVersion

    maxVersion = 0
    strComputer = "."
    Set objWMIService = GetObject("winmgmts:\\" & strComputer & "\root\cimv2")
    Set colItems = objWMIService.ExecQuery("Select Name, Version from Win32_Product Where Name Like 'Microsoft .NET Framework%'")

    For Each objItem in colItems
        WriteLog "Detected Framework Version: " & objItem.Version & " - " & objItem.Name
        If objItem.Version > maxVersion Then

            maxVersion = objItem.Version

        End If


    MaxFrameworkVersionCheck = maxVersion

    End Function

    Thursday, May 3, 2018 9:03 PM


All replies