| |
ehvbs
Posts: 2169
Score: 50
Joined: 6/22/2005
From: Germany
Status: offline
|
[sethsdad, you are too fast for me!] Some slightly other version: Dim sPath Dim aKeys Dim WSHShell Dim sKey Dim vRegValue sPath = "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\HotFix\" aKeys = Array( "KB329115\Installed", "KB828749\Installed", "RealOS\Installed" ) Set WSHShell = WScript.CreateObject( "WScript.Shell" ) For Each sKey In aKeys vRegValue = readRegistry( WSHShell, sPath + sKey ) If IsEmpty( vRegValue ) Then msgbox "hotfix " + sKey + " bad" Else msgbox "hotfix " + sKey + " ok" End If Next Function readRegistry( oShell, sKey ) Dim vRegValue ' starts Empty On Error Resume Next vRegValue = oShell.RegRead( sKey ) On Error GoTo 0 readRegistry = vRegValue End Function
|
|