hani-dev Posted May 24, 2017 Share Posted May 24, 2017 (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 May 24, 2017 by hani-dev Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 24, 2017 Moderators Share Posted May 24, 2017 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 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
hani-dev Posted May 24, 2017 Author Share Posted May 24, 2017 (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 May 24, 2017 by hani-dev Link to comment Share on other sites More sharing options...
Moderators JLogan3o13 Posted May 24, 2017 Moderators Share Posted May 24, 2017 Yes, try an If statement: $sVal = RegRead($sKey & $sSubKey, "DisplayName") If $sVal <> "" Then ... Else ... EndIf I'll let you fill in the particulars. hani-dev 1 "Profanity is the last vestige of the feeble mind. For the man who cannot express himself forcibly through intellect must do so through shock and awe" - Spencer W. Kimball How to get your question answered on this forum! Link to comment Share on other sites More sharing options...
hani-dev Posted May 24, 2017 Author Share Posted May 24, 2017 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 Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now