Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. recursively search the registry and delete text

recursively search the registry and delete text

Scheduled Pinned Locked Moved C / C++ / MFC
windows-adminhelpquestion
2 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • D Offline
    D Offline
    Derek Smigelski
    wrote on last edited by
    #1

    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

    J 1 Reply Last reply
    0
    • D Derek Smigelski

      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

      J Offline
      J Offline
      Joan M
      wrote on last edited by
      #2

      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...

      https://www.robotecnik.com freelance robots, PLC and CNC programmer.

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups