Option Explicit
Dim obj
Set obj = CreateObject("WScript.Shell")
On Error Resume Next
Dim value
value = obj.RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
If Err <> 0 Then
Msgbox Err.Description
Err.Clear
Else
MsgBox value
End If