| |
jbird
Posts: 33
Score: 0
Joined: 6/25/2004
From: USA
Status: offline
|
You could use the Enumkey method on the Profiles key to place all subkeys in an array and then just use a for loop to cycle through the array to check if it exists. Example. '************************************************************************************************ 'Beginning of Code Const HKEY_CURRENT_USER = &H80000001 Dim strKey Dim arrSubKeys() Dim objReg Dim strComputer strComputer = "." Set objReg=GetObject("winmgmts:{impersonationLevel=impersonate}!\\" & _ strComputer & "\root\default:StdRegProv") strKey = "Software\Microsoft\Windows NT\CurrentVersion\Windows Messaging Subsystem\Profiles" objReg.EnumKey HKEY_CURRENT_USER, strKey, arrSubKeys 'The next section will just go through the array to find the desired key. For intI = 0 to UBound(arrSubKeys) If arrSubKeys(intI) = "EXCHANGE" Then WScript.Echo "EXCHANGE does exist." End If Next 'End of Code '************************************************************************************************ The echo statement could be replaced with any indicator you want to use. For example you could set a variable to true if the Exchange key exists. Hope this helps, Jay
|
|