I have a simple function whereby I pass in the name of a Registry Key Path.
I have a const variable of HKLM = &H80000002.
I'm passing in the following Check on this path:
sKeyPath = "SYSTEM\CurrentControlSet\
I just want to check to make sure that the "Eventlog" folder exists and that's it.
When I make the function call I've tried passing in the following different parameters:
If regKeyExists(sKeyPath) and If regKeyExists(HKLM & "\" & sKeyPath)
I'm getting this error and it's driving me nuts. I'm not sure what else it could be:
Please see code below.
On Error Resume Next
Dim oShll, rKey
Set oShll = CreateObject("WScript.Shell")
rKey = oShll.RegRead(Key)
If Err.Number <> 0 Then
regKeyExists = False
regKeyExists = True
Set oShll = Nothing