Enumerating the Registry...

R

ross m. greenberg

I'm trying to fully enumerate the Registry: I want to take a snapshot before an event, and then a snapshot after that and list all the differences, both in the new and removed keys/sub keys as well as changes in the values.

I'm using Visual Studio/Basic 2005 Professional and .Net 2.0

Anybody have any spare code thing about?

Thanks!

Ross
 
B

Bob Butler

ross m. greenberg said:
I'm trying to fully enumerate the Registry: I want to take a snapshot
before an event, and then a snapshot after that and list all the
differences, both in the new and removed keys/sub keys as well as changes
in the values.

I'm using Visual Studio/Basic 2005 Professional and .Net 2.0

I don't use VB 2005 but one thing you may need to watch out for is registry
virtualization. If you enumerate everything under HKCU you will end up
reading large chunks of HKLM because Vista creates a virtual view of the
registry that merges the two. I've gotten around that by using
impersonation but there are other options. See
http://msdn2.microsoft.com/en-us/library/aa965884.aspx for more info.

As far as VB 2005 coding you might want to post your question in a newsgroup
with "dotnet" in the name since those are generally for .Net programming.
 
A

Andrew McLaren

ross m. greenberg said:
I'm trying to fully enumerate the Registry: I want to take a snapshot
before an event, and then a snapshot after that and list all the
differences, both in the new and removed keys/sub keys as well as changes
in the values.
I'm using Visual Studio/Basic 2005 Professional and .Net 2.0
Anybody have any spare code thing about?


Hi Ross,

For code samples, you could start with the Visual Studio 2005 Code Snippets.
These are "pre-packed" blocks of code to perform routing tasks, like reading
and writing to the Registry. There are about 500 snippets in-the-box, plus
some more online. You can find a snippet, then modify it to your heart's
content.

Search for "Visual Basic IntelliSense Code Snippets" in the VS2005 online
help.

Or, good sites to search for code samples:
http://www.codeproject.com/
http://www.gotdotnet.com/
http://www.codeplex.com/

For programming type questions, you'll probably get better results asking in
a newsgroup like microsoft.public.vstudio.general. Most folks in
microsoft.public.windows.vista.general are just users.

Are you sure you want to take a snapshot of the *whole* registry?? That
could be many hundreds of megabytes on a busy server. Maybe you'd want to
focus on specific Hives or Keys of interest. While it's not programmatic,
you can also (of course) make before-and-after snapshots of the registry
using the REG command at a command prompt.

Hope it helps,
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top