I had a few errors in the code. Also, forgot REDIM PRESERVE doesn't work on multi-dimensional arrays. I just made it an arbitrarily large array. Here are the corrections:
 Code:
Function CheckDotNet(optional $strComputer)
   ; Function:   CheckDotNet
   ;
   ; Author:     Brad Van Orden
   ;             Based on Microsoft Developer Network article:
   ;             How to: Determine Which .NET Framework Versions Are Installed
   ;
   ; Syntax:     CheckDotNet(\[{$strComputer])
   ;
   ; Parameters:  Optional name of remote system to query.
   ;              If omitted, will query the current system.
   ;
   ; Returns:    Two dimensional array.  The first dimension will be the major
   ;             version number.  The second the complete version.
   ;
   ; Dependencies: None
   ;
   DIM $strKey, $intIndex, $strKeyName, $strVers, $arrVer[10,11]
   ;
   If $strComputer = ""
      $strComputer = "."
   EndIf
   ;
   $strKey = "\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP"
   $intIndex = 0
   $intI     = 0
   If KeyExist("\\" + $strComputer + $strKey)
      $strKeyName = EnumKey("\\" + $strComputer + $strKey, $intIndex)
      While Not @ERROR
         If $strKeyName <> "CDF"
            ; Want to ignore the CDF key
            If Left($strKeyName, 2) = "v1"
               ; The version 1 setup is different.  Need to treat it separately.
               $arrVer[$intI, 0] = Left($strKeyName, 2)
               $arrVer[$intI, 1] = Substr($strKeyName, 2)
               $intI = $intI + 1
            Else
               If $strKeyName <> "v4.0"
                  ; Ignore that subkey
                  If $strKeyName = "v4"
                     $strVers = ReadValue("\\" + $strComputer + $strKey + "\" + $strKeyName + "\Full", "Version")
                     $arrVer[$intI, 0] = $strKeyName
                     $arrVer[$intI, 1] = $strVers
                     $intI = $intI + 1
                  Else
                     $strVers = ReadValue("\\" + $strComputer + $strKey + "\" + $strKeyName, "Version")
                     If Left($strKeyName, 2) = "v2"
                        $arrVer[$intI, 0] = Left($strKeyName, 2)
                     Else
                        $arrVer[$intI, 0] = $strKeyName
                     EndIf
                     $arrVer[$intI, 1] = $strVers
                     $intI = $intI + 1
                  EndIf
               EndIf
            EndIf
         EndIf
         $intIndex = $intIndex + 1
         $strKeyName = EnumKey("\\" + $strComputer + $strKey, $intIndex)
      Loop
   EndIf
   ; To mark the end of the array, place a -1 in the next array position.
   $arrVer[$intI, 0] = -1
   $CheckDotNet = $arrVer
EndFunction


I have an ini file with all of the computers in the active directory and use that when probing all of the systems. It just looks like:
 Code:
[computers]
comp1=name1
comp2=name2
I then called with:
 Code:
Break On
DIM $SO
$SO = SetOption('Explicit',          'On')
$SO = SetOption('NoMacrosInStrings', 'On')
DIM $arrDotNet[10,11], $strFile, $intI, $intErr
DIM $strWks, $strComps, $colComps, $objComp
include "functions.kix"
;
$strFile  = "c:\temp\dotnet.ini"
$strComps = "c:\temp\computers.ini"
;
$colComps = Split(ReadProfileString($strComps, "computers", ""),chr(10))
For Each $objComp in $colComps
   If $objComp <> ""
      $strWks = ReadProfileString($strComps, "computers", $objComp)
      ? "Checking for installed .net versions on: " + $strWks
      $arrDotNet = CheckDotNet($strWks)
      $intI = 0
      While $arrDotNet[$intI, 0] <> -1
         $intErr = WriteProfileString($strFile,$strWks,$arrDotNet[$intI,0],$arrDotNet[$intI,1])
         $intI = $intI + 1
      Loop
   Else
      ? "Did not receive results from: " + $strWks
      $intErr = WriteProfileString($strFile,$strWks,"DOTNET","Could not read from this system.")
   EndIf
Next
which gave me the dotnet versions on each host. \:\)


Edited by BradV (2016-01-05 11:48 AM)
Edit Reason: fixed optional