' Constants used in this script Const HKCR = &H80000000 'HKEY_CLASSES_ROOT Const HKCU = &H80000001 'HKEY_CURRENT_USER Const HKLM = &H80000002 'HKEY_LOCAL_MACHINE Const HKU = &H80000003 'HKEY_USERS Const HKCC = &H80000005 'HKEY_CURRENT_CONFIG Const REG_SZ =1 Const REG_EXPAND_SZ =2 Const REG_BINARY =3 Const REG_DWORD =4 Const REG_MULTI_SZ =7 Const CURRENT_DOTNETVERSION = "1" section = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" key="SP" hive = "HKEY_LOCAL_MACHINE" tree = "SOFTWARE\Microsoft\NET Framework Setup\NDP\v3.5" ' Convert specified hive to associated constant Select Case hive Case "HKEY_CLASSES_ROOT" hkey = HKCR Case "HKEY_CURRENT_CONFIG" hkey = HKCC Case "HKEY_CURRENT_USER" hkey = HKCU Case "HKEY_LOCAL_MACHINE" hkey = HKLM Case "HKEY_USERS" hkey = HKU Case Else Syntax End Select ' Connect to the registry Set oReg = GetObject( "winmgmts:!root/default:StdRegProv" ) ' Read and display the requested value regVal = GetRegistryVal( hkey, tree, key ) regValArray = Split( regVal, "=", 2 ) 'WScript.Echo regVal If UBound(regvalArray) >= 1 Then version=regvalArray(1) End if If version <> CURRENT_DOTNETVERSION Then 'WScript.Echo "Please install .Net version 3.5 sp1 to run RM" msg = "Dell Repository Manager requires .Net version 3.5 SP1. Install the correct version of .Net Framework and try again." ' Define message. title = ".Net Framework version check failed" ' Define title. ' Display message. response = MsgBox(msg, 16, title) Else 'WScript.Echo vbCrLf & "Just a debug message" & vbCrLf & ".Net version 3.5 sp1 available click OK to run Repository Manager" Set oShell = WScript.CreateObject("WScript.Shell") oShell.Exec("RM\RepositoryManager repository\catalog.cab") 'oShell.Run "RM\RepositoryManager" , 1, FALSE Set oShell = Nothing End If '*********************************************************************** '* Function Name: GetRegistryVal * '* Inputs: hive, tree, key * '* Example WScript.Echo GetVal( HKCU, "Environment", "Path" ) * '* Returns: Value in the format NAME=VALUE * '*********************************************************************** Function GetRegistryVal( strHive, strTree, strKey ) ' Read all keys and their values for the entire section into an array If oReg.EnumValues( strHive, strTree, sKeys, iKeyType ) Then GetRegistryVal = "-None-" Else For Count = 0 to UBound( sKeys ) ' Select the requested key If strKey = UCase( sKeys( Count ) ) Then ' Format the output Select Case iKeyType( Count ) Case REG_SZ oReg.GetStringValue strHive, strTree, sKeys( Count ), sValue GetVal = sKeys( Count ) & "=" & sValue Case REG_EXPAND_SZ oReg.GetExpandedStringValue strHive, strTree, sKeys( Count ), sValue GetVal = sKeys( Count ) & "=" & sValue Case REG_BINARY oReg.GetBinaryValue strHive, strTree, sKeys( Count ), aValue GetVal = sKeys( Count ) & "=" & Join( aValue,"" ) Case REG_DWORD oReg.GetDWORDValue strHive, strTree, sKeys( Count ), lValue GetVal = sKeys( Count ) & "=" & lValue Case REG_MULTI_SZ oReg.GetMultiStringValue strHive, strTree, sKeys( Count ), sValue GetVal = sKeys( Count ) & "=" & Join( sValue,"" ) End Select End If Next GetRegistryVal = GetVal '"[" & section & "]" & vbCrLf & GetVal End If End Function Sub Syntax strMsg = vbCrLf & "RM Launcher" WScript.Echo strMsg WScript.Quit(1) End Sub