View Single Post
Old 07-02-2009   #8 (permalink)
PaulM


 
 

Re: Help with vbs script

I tried your script on windows 7, and you are right.
I added the key and the script run it said ,"The registry key does exists"
ever if the key is there.

--
Windows XP and Vista Tweaks
------------------------------------------------------------
www.paulsxp.com
------------------------------------------------------------
Windows XP and Vista Help Forum
------------------------------------------------------------
www.paulsxp.com/forum
------------------------------------------------------------
Live Computer Help and Chat
------------------------------------------------------------
www.paulsxp.com/livesupport.html
------------------------------------------------------------


"Mark D. MacLachlan" <markdmac@xxxxxx> wrote in message
news:eT5vAU1#JHA.1252@xxxxxx
Quote:

> 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