Home > Archive > VBScript > September 2004 > Searching the Uninstall with RegRead
You are viewing an archived Text-only version of the thread.
To view this thread in it's original format and/or if you want to reply to
this thread please [click here]
| Author |
Searching the Uninstall with RegRead
|
|
| Anthony 2004-09-25, 3:55 pm |
| Is it possible to get all the keys in
hklm\software\microsft\windows\currentve
rsion\uninstall\ (the add and
remove programs list) put them into and array and then search the array
for DisplayName key for an application?
I am trying to determine if a product is installed, like Office XP.
TIA.
| |
| y sakuda 2004-09-25, 3:55 pm |
| "Anthony" <nomorespam@msn.com> wrote in message news:%23dye3ByoEHA.3724@TK2MSFTNGP10.phx.gbl...
> Is it possible to get all the keys in
> hklm\software\microsft\windows\currentve
rsion\uninstall\ (the add and
> remove programs list) put them into and array and then search the array
> for DisplayName key for an application?
>
Something like this?
If your OS is'nt XP or Win2000Pro,I suppose you can't enumerate subkeys.
Note: Some application don't have DisplayName
Y Sakuda from JPN
Const HKLM = &H80000002
Dim oReg, SubKey, arrSubKeys, strKeyPath, wDisp
Dim wKeyAry(), wDispAry(), I
Set oReg = GetObject("winmgmts:root\default:StdRegProv")
strKeyPath = " SOFTWARE\Microsoft\Windows\CurrentVersio
n\Uninstall"
oReg.EnumKey HKLM, strKeyPath, arrSubKeys
I = 0
For Each SubKey In arrSubKeys
ReDim Preserve wKeyAry(I)
ReDim Preserve wDispAry(I)
wKeyAry(I) = SubKey
oReg.GetStringValue HKLM, strKeyPath & "\" & SubKey, "DisplayName", wDisp
wDispAry(I) = wDisp
wscript.Echo "KeyName=" & wKeyAry(I) & ", DisplayName=" & wDispAry(I)
I = I + 1
Next
| |
|
|
| Steven Burn 2004-09-26, 3:55 pm |
| Thats not a very reliable way of doing it.......
You'd be much better off attempting to locate the programs folder, and doing
a fileexists on it's executable.
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
"Anthony" <nomorespam@msn.com> wrote in message
news:#dye3ByoEHA.3724@TK2MSFTNGP10.phx.gbl...
> Is it possible to get all the keys in
> hklm\software\microsft\windows\currentve
rsion\uninstall\ (the add and
> remove programs list) put them into and array and then search the array
> for DisplayName key for an application?
>
> I am trying to determine if a product is installed, like Office XP.
>
> TIA.
| |
| Anthony 2004-09-27, 3:55 pm |
| y sakuda wrote:
> "Anthony" <nomorespam@msn.com> wrote in message news:%23dye3ByoEHA.3724@TK2MSFTNGP10.phx.gbl...
>
>
> Something like this?
> If your OS is'nt XP or Win2000Pro,I suppose you can't enumerate subkeys.
> Note: Some application don't have DisplayName
> Y Sakuda from JPN
>
> Const HKLM = &H80000002
> Dim oReg, SubKey, arrSubKeys, strKeyPath, wDisp
> Dim wKeyAry(), wDispAry(), I
> Set oReg = GetObject("winmgmts:root\default:StdRegProv")
> strKeyPath = " SOFTWARE\Microsoft\Windows\CurrentVersio
n\Uninstall"
> oReg.EnumKey HKLM, strKeyPath, arrSubKeys
> I = 0
> For Each SubKey In arrSubKeys
> ReDim Preserve wKeyAry(I)
> ReDim Preserve wDispAry(I)
> wKeyAry(I) = SubKey
> oReg.GetStringValue HKLM, strKeyPath & "\" & SubKey, "DisplayName", wDisp
> wDispAry(I) = wDisp
> wscript.Echo "KeyName=" & wKeyAry(I) & ", DisplayName=" & wDispAry(I)
> I = I + 1
> Next
Thanks for the reply, could you explain how this works?
Thanks.
| |
| Anthony 2004-09-27, 3:55 pm |
| Steven Burn wrote:
> Thats not a very reliable way of doing it.......
>
> You'd be much better off attempting to locate the programs folder, and doing
> a fileexists on it's executable.
>
> --
>
> Regards
>
> Steven Burn
> Ur I.T. Mate Group
> www.it-mate.co.uk
>
> Keeping it FREE!
>
>
> "Anthony" <nomorespam@msn.com> wrote in message
> news:#dye3ByoEHA.3724@TK2MSFTNGP10.phx.gbl...
>
>
>
>
Wouldn't that have to search the entire drive?
| |
|
|
|
| Hi,
Yes it is possible, and IMHO the best way to do it.
Regards,
rusga
On Mon, 27 Sep 2004 06:20:20 -0700, Anthony <nomorespam@msn.com> wrote:
> Steven Burn wrote:
>
> Wouldn't that have to search the entire drive?
| |
| Steven Burn 2004-09-28, 8:55 am |
| Not at all.........
If you can get the path via the registry, there's no need to search the
whole drive (though even this can be acheived in seconds as you'd only need
to search the \Program Files\ folder).
--
Regards
Steven Burn
Ur I.T. Mate Group
www.it-mate.co.uk
Keeping it FREE!
"Anthony" <nomorespam@msn.com> wrote in message
news:41581394.7020503@msn.com...
> Steven Burn wrote:
>
doing[color=darkred]
> Wouldn't that have to search the entire drive?
|
|
|
|
|