View Single Post
Old 07-02-2009   #7 (permalink)
Mark D. MacLachlan


 
 

Re: Help with vbs script

Yes, I am indeed talking about that script. I agree it does work fine
for most registry reads, however it does not work (on my Windows 7 x64
system) when trying to read an Uninstall key down at the curly braces
level.

I am able to successfully read up to
SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall however trying to
read a value past that point failes. I would be greatful for someone
else to verify my findings by trying to read a path such as
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{
90120000-002A-0000-1000-0000000FF1CE}

That is the path to the "Microsoft Office Office 64-bit Components
2007".


Code I am trying is:
Code:
Const HKEY_LOCAL_MACHINE = &H80000002

strComputer = "."
Set objRegistry = GetObject("winmgmts:\\" & _
strComputer & "\root\default:StdRegProv")

strKeyPath = "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall"
strValueName = "{90120000-002A-0000-1000-0000000FF1CE}"
objRegistry.GetStringValue
HKEY_LOCAL_MACHINE,strKeyPath,strValueName,strValue

If IsNull(strValue) Then
Wscript.Echo "The registry key does not exist."
Else
Wscript.Echo "The registry key exists."
End If
The OP is trying to read such a value, so I think this script will
serve them well on an older OS but not Windows 7 unless someone can
confirm the problem is just on my side.

Regards,

Mark D. MacLachlan
My System SpecsSystem Spec