recursively search the registry and delete text
-
I need some help. I need source code that will recursively search the registry and delete text found. It would need to work on 95/98/NT/XP/2000. I'm looking to return a list (perhaps in a list box) of all keys (ALL TEXT) that were found. If that Text appears anywhere in registry I want it added to my list. Then I can select/deselect what I wish and then delete the selected items. Allow someone to highlight and delete specific ones. Any ideas? Any help is appreciated. Cheers, Derek
-
I need some help. I need source code that will recursively search the registry and delete text found. It would need to work on 95/98/NT/XP/2000. I'm looking to return a list (perhaps in a list box) of all keys (ALL TEXT) that were found. If that Text appears anywhere in registry I want it added to my list. Then I can select/deselect what I wish and then delete the selected items. Allow someone to highlight and delete specific ones. Any ideas? Any help is appreciated. Cheers, Derek
try this: HKEY hKey = NULL; CString csCadenaA[10]; CString csCadenaB[10]; csCadenaA[0] = "Software\\akuna\\matata\\"; csCadenaB[0] = "LionKing"; csCadenaA[1] = "Software\\lilo\\stitch\\"; csCadenaB[1] = "ls"; for (int i=0;i<10;i++) { RegOpenKeyEx(HKEY_LOCAL_MACHINE,csCadenaA[i],0,KEY_ALL_ACCESS,&hKey); if (hKey != NULL) { RegDeleteKey(hKey, csCadenaB[i]); } } OK, the strings used in this sample are stupid, but it works... Hope this helps...