How do i read and write from the real (64 bit) registry from a 32 bit vbs running on 2008 or Win7

I want to read and write to the real (64 bit) registry on windows 7 and 2008.

How do I do that?

Thanks
Christopher ScheneSystem Engineer/Software EngineerAsked:
Who is Participating?

Improve company productivity with a Business Account.Sign Up

x
 
connectexConnect With a Mentor Commented:
Yes, I've done it in C++ using the old Win32 functions. I haven't moved up to .NET for everything yet. I write command line programs to assist in my automation task. I only do this when I can't find another program that fits my needs.
0
 
connectexCommented:
There's optional flag that's can be used on Win32 registry calls to allow a 32-bit program to read the 64-bit registry (and vice-versa). Let me see what I can find on the .NET side.
0
 
connectexCommented:
I found information about the registry virtualization flags. Here's the article: http://msdn.microsoft.com/en-us/library/ms724878(v=vs.85).aspx. Notice the KEY_WOW64_64KEY and KEY_WOW64_32KEY flags. But I'm still working on how to pass them to the .NET calls.
0
Problems using Powershell and Active Directory?

Managing Active Directory does not always have to be complicated.  If you are spending more time trying instead of doing, then it's time to look at something else. For nearly 20 years, AD admins around the world have used one tool for day-to-day AD management: Hyena. Discover why

 
connectexCommented:
This post goes in to more details: http://blogs.msdn.com/cumgranosalis/archive/2005/12/19/Win64RegistryPart2.aspx. It seems up until .NET 4.0 it wasn't possible to manage both side of the virtualize registry. What version on .NET are you using?
0
 
Christopher ScheneSystem Engineer/Software EngineerAuthor Commented:
On the Win7 and 2008 machines I am running on, I believe 3.5 SP1 is always installed by default.

I wonder if I can use just a plain old C++ program to do this.
0
 
Christopher ScheneSystem Engineer/Software EngineerAuthor Commented:
or maybe Java?
0
 
connectexCommented:
So it seems you need to move up to .NET 4.x or use the pinvoke functionality. It's really not very clean either way based on what you've told me.
0
 
Christopher ScheneSystem Engineer/Software EngineerAuthor Commented:
Sorry, i was pulled off on something else.

I can't rely on .net 4.0 being there so I am out of luck in that direction.

I have IS 2010 (I am usng 2008)...so I'll see if 2010 will work.

I can do Win32 if I REALLY need to,,but hopefull I can avoid that.
0
 
Christopher ScheneSystem Engineer/Software EngineerAuthor Commented:
I really don't have a "how to  implement it" answer, but it is a complex question and I appreciate the help
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.