Iterate Registry with RegistryAccess object

Support for all customers who have purchased or received a Productivity Pack Support product license. This forum does not offer a response time guarantee.
Forum rules
DO NOT POST SUBSCRIPTION NUMBERS, LICENSE KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
Locked
User avatar
tonilocoyote
Posts: 1
Joined: Tue Oct 06, 2009 9:10 pm

Iterate Registry with RegistryAccess object

Post by tonilocoyote » Tue Oct 06, 2009 9:10 pm

What is the best way for iterating through the registry with RegistryAccess object?

It will be appreciated an example for deleting entire key branches due RegistryAccess can't do it if the key has one or more child subkeys.

I know I must use recursive function calls, etc., but, what is the best way? Whether opening each subkey by creating a new RegistryAccess object for each iteration, or by using GetSubKey() for each one, or even by moving the same object downward the tree with GotoSubKey() and then upward with GotoParentKey()?

I suppose that by means of one of the above procedures I must fill a flat array of strings with the full name of every branch in order of using each of these strings to call DeleteKey() in a final pass and in inverted order.

What is the way of doing that with the best performance and less time/memory overhead?

Thank you.

User avatar
davidc
Posts: 5838
Joined: Thu Aug 18, 2011 4:56 am

Iterate Registry with RegistryAccess object

Post by davidc » Wed Oct 07, 2009 1:14 am

I recommend posting this question on http://www.ScriptingAnswers.com.
This board is reserved for questions about our free tools.

Thank you,

David
David
SAPIEN Technologies, Inc.

User avatar
Alexander Riedel
Posts: 6920
Joined: Tue May 29, 2007 4:43 pm

Iterate Registry with RegistryAccess object

Post by Alexander Riedel » Wed Oct 07, 2009 1:16 am

That is a good question actually. We will make that a subject of a blog post soon, so keep an eye on www.sapien.com/blog

Alex
Alexander Riedel
SAPIEN Technologies, Inc.

Locked