Yes, I admit I'm an engineer. I'm new to this but I'm thinking
logically here. I'm looking for if..than statement examples. Yes,
I've found tons but it really doesn't explain anything to me. For
example, I'm looking for a basic script that would say If you find a
particular registry key with a particular string value, than delete
it. If you you don't find a particular registry key with it's string
value, than move on to the rest of the script. I can't find anything
like that. I can't even find if you find the key, rename it, modify
it, smile at it......
Am I too much of an engineer and this is working my left brain, the
side I've probably never touched, probably rotted out???? I've
created a delreg key and it works fine - see:
******************************************************
Const HKLM = &H80000002
sKey = "SOFTWARE\Lotus\Notes"
Set oReg = GetObject _
("WinMgmts:{impersonationLevel=impersonate}!//./root/default:StdRegProv")
DeleteRegistryKey HKLM, sKey
Sub DeleteRegistryKey(ByVal sHive, ByVal sKey)
Dim aSubKeys, sSubKey, iRC
On Error Resume Next
iRC = oReg.EnumKey(sHive, sKey, aSubKeys)
If iRC = 0 And IsArray(aSubKeys) Then
For Each sSubKey In aSubKeys
If Err.Number <> 0 Then
Err.Clear
Exit Sub
End If
DeleteRegistryKey sHive, sKey & "\" & sSubKey
Next
End If
oReg.DeleteKey sHive, sKey
End Sub
*****************************************************************
Not bad for an engineer - whatever.... Anyway, is this something that
can be done? Thanks to anyone that can help me out, point me in the
right direction.