Shawndt Posted February 9, 2010 Posted February 9, 2010 Good Morning Ladies and Gents, I went through the list of question. I did not see this question. I am trying to read on a pc, all programs install. My problem is the applications and their unique keys. IS there a way I can read the key as a variable or something? sort of like @computername? $var = RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\uninstall", "DisplayName") MsgBox(4096, "Currently installed programs:", $var)
KaFu Posted February 9, 2010 Posted February 9, 2010 A small adjustment to my _EnumRegKeys2Array() UDF does the trick...expandcollapse popup#include<Array.au3> $aResult = _EnumRegKeys2Array("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\uninstall") _ArrayDisplay($aResult) Func _EnumRegKeys2Array($sRegKey) Local Const $REG_NONE = 0 Local Const $REG_SZ = 1 Local Const $REG_EXPAND_SZ = 2 Local Const $REG_BINARY = 3 Local Const $REG_DWORD = 4 Local Const $REG_DWORD_BIG_ENDIAN = 5 Local Const $REG_LINK = 6 Local Const $REG_MULTI_SZ = 7 Local Const $REG_RESOURCE_LIST = 8 Local Const $REG_FULL_RESOURCE_DESCRIPTOR = 9 Local Const $REG_RESOURCE_REQUIREMENTS_LIST = 10 Local Const $REG_QWORD = 11 ; Vista Local $aResult[1][3], $aResult_sub, $i, $y Local $sRegKey_Name, $sRegKey_Value, $sRegKey_Type if stringright($sRegKey,1) <> "\" then $sRegKey = $sRegKey & "\" $aResult[0][0] = "0" $i = 1 while 1 $sRegKey_Name = RegEnumVal($sRegKey, $i) if @error then ExitLoop if not StringInStr($sRegKey_Name, "DisplayName") then $i += 1 ContinueLoop EndIf redim $aResult[ubound($aResult)+1][3] $aResult[ubound($aResult)-1][0] = $sRegKey & $sRegKey_Name $sRegKey_Value = RegRead($sRegKey,$sRegKey_Name) $sRegKey_Type = @extended if $sRegKey_Type = $REG_NONE then $sRegKey_Type = "REG_NONE" if $sRegKey_Type = $REG_SZ then $sRegKey_Type = "REG_SZ" if $sRegKey_Type = $REG_EXPAND_SZ then $sRegKey_Type = "REG_EXPAND_SZ" if $sRegKey_Type = $REG_BINARY then $sRegKey_Type = "REG_BINARY" if $sRegKey_Type = $REG_DWORD then $sRegKey_Type = "REG_DWORD" if $sRegKey_Type = $REG_DWORD_BIG_ENDIAN then $sRegKey_Type = "REG_DWORD_BIG_ENDIAN" if $sRegKey_Type = $REG_LINK then $sRegKey_Type = "REG_LINK" if $sRegKey_Type = $REG_MULTI_SZ then $sRegKey_Type = "REG_MULTI_SZ" if $sRegKey_Type = $REG_RESOURCE_LIST then $sRegKey_Type = "REG_RESOURCE_LIST" if $sRegKey_Type = $REG_FULL_RESOURCE_DESCRIPTOR then $sRegKey_Type = "REG_FULL_RESOURCE_DESCRIPTOR" if $sRegKey_Type = $REG_RESOURCE_REQUIREMENTS_LIST then $sRegKey_Type = "REG_RESOURCE_REQUIREMENTS_LIST" if $sRegKey_Type = $REG_QWORD then $sRegKey_Type = "REG_QWORD" ; Vista $aResult[ubound($aResult)-1][1] = $sRegKey_Value $aResult[ubound($aResult)-1][2] = $sRegKey_Type $i += 1 WEnd $i = 1 while 1 $sRegKey_Name = RegEnumKey($sRegKey, $i) if @error then ExitLoop $aResult_sub = _EnumRegKeys2Array($sRegKey & $sRegKey_Name) if ubound($aResult_sub) > 1 Then for $y = 1 to UBound($aResult_sub)-1 redim $aResult[ubound($aResult)+1][3] $aResult[ubound($aResult)-1][0] = $aResult_sub[$y][0] $aResult[ubound($aResult)-1][1] = $aResult_sub[$y][1] $aResult[ubound($aResult)-1][2] = $aResult_sub[$y][2] next EndIf $i += 1 WEnd $aResult[0][0] = UBound($aResult)-1 return $aResult EndFunc OS: Win10-22H2 - 64bit - German, AutoIt Version: 3.3.16.1, AutoIt Editor: SciTE, Website: https://funk.eu AMT - Auto-Movie-Thumbnailer (2024-Oct-13) BIC - Batch-Image-Cropper (2023-Apr-01) COP - Color Picker (2009-May-21) DCS - Dynamic Cursor Selector (2024-Oct-13) HMW - Hide my Windows (2024-Oct-19) HRC - HotKey Resolution Changer (2012-May-16) ICU - Icon Configuration Utility (2018-Sep-16) SMF - Search my Files (2024-Oct-20) - THE file info and duplicates search tool SSD - Set Sound Device (2017-Sep-16)
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