Sign in to follow this  
Followers 0
Shawndt

Add /Remove Programs List

2 posts in this topic

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)

Share this post


Link to post
Share on other sites



A small adjustment to my _EnumRegKeys2Array() UDF does the trick...

#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

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
Sign in to follow this  
Followers 0