VB6 reading regsitery

Hello Experts,

I have an application that is supposed to read a registery key and populate a label with it's value. Here is the code:

    Dim oReg As Object
    Set oReg = CreateObject("WScript.Shell")
    lbl_LMIName.Caption = oReg.RegRead("HKLM\Software\LogMeIn\V5\WebSvc\" & "HostDescription")
    Set oReg = Nothing

Open in new window


It works perfect on WinXP but all other OS (7, 2008, 2012) it throws this error:

---------------------------
RemoteSupportUpdater
---------------------------
Run-time error '-2147024894 (80070002)':

Invalid root in registry key "HKLM\Software\LogMeIn\V5\WebSvc\HostDescription".
---------------------------
OK  
---------------------------

But the path does exist in the registry. Any ideas on what I am doing wrong?
triphenAsked:
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Scott CSenior EngineerCommented:
A quick search on that error turned up that there was some kind of incompatibility in the API.

http://answers.microsoft.com/en-us/office/forum/office_2010-customize/run-time-error-214702489-80070002/3bc02610-f710-4136-8640-464f9ed9cf36

I also found a reference to where there was a bitblip in the registry.

http://www.sevenforums.com/windows-updates-activation/310222-windows-7-update-error-80070002-story-fix.html

Make sure to go through it character by character.
0
triphenAuthor Commented:
Thanks for your quick response. I don't believe the first link applies to me and I went through letter by letter for the second link. See attached, the path is definitely there in the right place.

I saw another posting that said it may be due to permissions. How can I elevate my code to run as higher permissions? I already tried right click Run As Admin....
0
triphenAuthor Commented:
Bump
0
Ultimate Tool Kit for Technology Solution Provider

Broken down into practical pointers and step-by-step instructions, the IT Service Excellence Tool Kit delivers expert advice for technology solution providers. Get your free copy now.

triphenAuthor Commented:
Anybody?
0
triphenAuthor Commented:
Bump.
0
triphenAuthor Commented:
No answers, closing question and opening a new one.
0

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
triphenAuthor Commented:
No answers, closing question and opening a new one.
0
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Visual Basic Classic

From novice to tech pro — start learning today.

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.