Identifying .Net Versions (VBScript)

AddThis Social Bookmark Button

As various versions of Windows include different versions of the .Net Framework and users can install additional versions through many channels it can be hard to determine exactly which versions of which frameworks are installed. This simple VBscript reports on the currently installed versions and service packs. Simply download the file and run or copy the code below to a .vbs file and save and then double click to run.

 

Dim Action_ :Set Action_ = CreateObject("Wscript.Shell")
Dim Obj_, Ver, Respond
Dim Regstry :Regstry = Array( _
"1 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\1.0.3705\Version", _
"1.1 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\1.1.4322\Version", _
"2 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727\Version", _
"3 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\Version", _
"3.5 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\Version", _
"4 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\Version")

 Dim RegstrySP :RegstrySP = Array( _
"1 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\1.0.3705\SP", _
"1.1 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\1.1.4322\SP", _
"2 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727\SP", _
"3 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.0\SP", _
"3.5 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5\SP", _
"4 - HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v4\Full\SP")

On Error Resume Next
Respond = Respond & ".NET VERSIONS" & vbCrLf 
For Each Obj_ In Regstry
     Ver = Split(Obj_," - ")
     If IsNull(Action_.RegRead(Ver(1))) Then
       Respond = Respond & "Not Installed: " & Ver(0) & vbCrLf 
     Else
       Respond = Respond & "Currently Installed: " & Ver(0) & " - " & "[" & Action_.RegRead(Ver(1)) & "]" & vbCrLf 
     End If
Next 

Respond = Respond &  vbCrLf & ".NET SERVICE PACKS" & vbCrLf 
For Each Obj_ In RegstrySP
     Ver = Split(Obj_," - ")
     If IsNull(Action_.RegRead(Ver(1))) Then
       Respond = Respond & "Not Installed: " & Ver(0) & vbCrLf 
     Else
       Respond = Respond & "Currently Installed: " & Ver(0) & " - " & "SP [" & Action_.RegRead(Ver(1)) & "]" & vbCrLf 
     End If
Next

MsgBox Respond, 64,".Net Framework Version Check"

 

Attachments:
Download this file (checknetversion.zip)checknetversion.zip0.6 kB2016-02-01

Only members can add comments. Becoming a member is free. See the Members section for more information.