>Hello All
>
>
>I am trying to delete certain subkeys from given key but it seems like Deletekey API function always return me 2
>
>Here is what I am trying to do:
>
>dimension laopt(1)
>lnRet=oreg.Enumoptions(@laopt,"Software\My keys\",HKEY_LOCAL_MACHINE,.f.)
>lnCount=alen(laopt,1)
>=oreg.openkey("Software\My keys\",HKEY_LOCAL_MACHINE)
>lnH=oreg.nCurrentkey
>FOR m.i = 1 TO lncount
> lnREt=oreg.DeleteKey(lnH,laopt(i,1))
>ENDFOR &&* m.i = 1 TO lncount
>
>
>What is wrong with the code above? I am using registry.prg taken from UT
>
>TIA
Hi,
The use of oreg.DeleteKey is to delete the "key" not the "key value".
Try this
FOR m.i = 1 TO lncount
lnRet = RegDeleteValue(lnH,laopt(i,1))
ENDFOR
oreg.DeleteKey(oReg.nUserKey, "Software\My keys\")
HTH
Herman