hani-dev

show registry data for each value in Subkeys loop !!

5 posts in this topic

#1 ·  Posted (edited)

hello there ....

sorry for my bad english ....

im trying to write script this script read all Subkeys  in : HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\ 

and then show them in console ,,, this is my code and it's working 

#pragma compile(Console, True)
#include <MsgBoxConstants.au3>

lena()
Func lena()

For $i = 1 to 100
    $sSubKey = RegEnumKey("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\", $i)



    If @error Then ExitLoop
    ConsoleWrite($sSubKey & @CRLF)

Next

EndFunc

now i need to modify my code to read this value : DisplayName for each subkey in HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\  and show here data next to $sSubKey like this 

{1F1C2DFC-2D24-3E06-BCB8-725134ADF989} || display name : (Java 8 Update 131 )

can u help me ... please

Edited by hani-dev

Share this post


Link to post
Share on other sites



#2 ·  Posted

Something like this, perhaps, to get you started:

Local $sKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"

For $i = 1 to 100
    $sSubKey = RegEnumKey($sKey, $i)
        If @error Then
            ExitLoop
        Else
            $sVal = RegRead($sKey & $sSubKey, "DisplayName")
            ConsoleWrite($sSubKey & "||" & $sVal & @CRLF)
        EndIf
Next

 


√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

53 minutes ago, JLogan3o13 said:

Something like this, perhaps, to get you started:

Local $sKey = "HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\"

For $i = 1 to 100
    $sSubKey = RegEnumKey($sKey, $i)
        If @error Then
            ExitLoop
        Else
            $sVal = RegRead($sKey & $sSubKey, "DisplayName")
            ConsoleWrite($sSubKey & "||" & $sVal & @CRLF)
        EndIf
Next

 

thanx u dear it's working ... but there are some value's that dont have displayname is there anyway to ignore them and just show the keys that have the displayname value ?

Edited by hani-dev

Share this post


Link to post
Share on other sites

#4 ·  Posted

Yes, try an If statement:

$sVal = RegRead($sKey & $sSubKey, "DisplayName")

If $sVal <> "" Then
    ...
Else
    ...
EndIf

I'll let you fill in the particulars.

1 person likes this

√-1 2^3 ∑ π, and it was delicious!

Share this post


Link to post
Share on other sites

#5 ·  Posted

2 minutes ago, JLogan3o13 said:

Yes, try an If statement:

$sVal = RegRead($sKey & $sSubKey, "DisplayName")

If $sVal <> "" Then
    ...
Else
    ...
EndIf

I'll let you fill in the particulars.

thanx u very much ... it's working <3

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!


Register a new account

Sign in

Already have an account? Sign in here.


Sign In Now