Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations TouchToneTommy on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Delete Registry Values 2

Status
Not open for further replies.

Varco

Programmer
Oct 22, 2000
49
US
Does anyone know how to delete all of the values under a specific Registry key, leaving any sub keys alone? I have code to delete a Registry key if you know the value name. I may not know the name, I need to loop through all of the values and delete them.

Thanks,

Jim Varco
jimv@varcconsulting.com
 
Use RegOpenKeyEx to open the key then Enumerate the subkeys using RegEnumKeys and get the values using RegQueryValue. Once you are done close the key using RegCloseKey.
 
A good source for all API related stuff is:


where you will find examples of the APIs that DrJavaJoe has wisely suggested

________________________________________________________________
If you want to get the best response to a question, please check out FAQ222-2244 first

'If we're supposed to work in Hex, why have we only got A fingers?'
 
My thanks to both DrJoeJava & johnwm for the help. Got exactly what I need now.

Jim Varco
jimv@varcconsulting.com
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top