Jump to content

Add/Remove Programs List


Recommended Posts

  • Moderators

So far I'm able to make it list some of the keys, but it gives a blank name on several that do have names. If I can get that issue figured out then I need to build an array to store all the key values and then create a listview from that. Any help on this would be great.

#include <RegCount.au3>
#include <Constants.au3>

opt("MustDeclareVars", 1)

HotKeySet("{Esc}", "Stop")

Dim $Key = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall"
Dim $TotalKeys = _RegKeyCount($Key)

For $i = 1 to $TotalKeys    
Dim $var = RegEnumKey($Key, $i)
    If @error <> 0 then ExitLoop
Dim $List = RegRead($Key & "\" & $var, "DisplayName")
    MsgBox(4096, "Display Name", "Key " & $i & "  " & $List)
Next
Exit
Func Stop()
    Exit
EndFunc

This is the RegCount UDF

Link to post
Share on other sites

May be this sample is helping you. I'm not the perfect programmer but you will be able to filter the entries with no Display Name.

Use AutoIt Beta >3.1.1..88

#include <RegCount.au3>

#include <Constants.au3>

#include <Array.au3>

#include <GUIConstants.au3>

#include <GuiList.au3>

opt("MustDeclareVars", 1)

HotKeySet("{Esc}", "Stop")

Dim $mainWindows,$var,$App,$ulist,$MSG,$but1,$Lvar,$i,$ret

$app="Display Uninstall"

$mainWindows=GUICreate($App, 800, 400,-1,-1)

$ulist=GUICtrlCreateList ("", 10,40,640,350,-1,-1)

$but1=GUICtrlCreateButton("Read Registry",10,10)

GUISetState(@SW_SHOW)

;

While 1;Run Gui until it closed

$msg = GUIGetMsg()

Select

Case $msg=$but1

ReadKeys()

case $MSG=$GUI_EVENT_CLOSE

Exit

EndSelect

WEnd

Func ReadKeys()

Dim $Key = "HKEY_LOCAL_MACHINE\Software\Microsoft\Windows\CurrentVersion\Uninstall"

Dim $TotalKeys = _RegKeyCount($Key)

;MsgBox(0,"",$TotalKeys)

Dim $List[$TotalKeys]

For $i = 1 to $TotalKeys

$var = RegEnumKey($Key, $i)

If @error <> 0 then ExitLoop

$List[$i-1] = RegRead($Key & "\" & $var, "DisplayName")

if $list[$i-1]="" then $List[$i-1]="No Display Name"

$Lvar=GUICtrlSetData($ulist,$List[$i-1]&" / "&$var)

Next

$ret = _GUICtrlListCount ($ulist)

; _ArrayDisplay( $List, "_ArrayDisplay() Test" );Display the Array

msgbox(0,"",$ret &" entry in listbox")

EndFunc

Func Stop()

Exit

EndFunc

Link to post
Share on other sites
  • 4 months later...

Thank for the sample, it helped out a lot.

Do you have the RegCount UDF, could you send it to me please?

I want to get a list of installed programs.

Thanks!

2015 - Still no flying cars, instead blankets with sleeves.

Link to post
Share on other sites

Hi,

in my PCInfo script is a func which writes the list to a file.

So long,

Mega

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

Link to post
Share on other sites

Thanks Mega!

:D No prob!

So long,

Mega

Hope it helped out ...

Scripts & functions Organize Includes Let Scite organize the include files

Yahtzee The game "Yahtzee" (Kniffel, DiceLion)

LoginWrapper Secure scripts by adding a query (authentication)

_RunOnlyOnThis UDF Make sure that a script can only be executed on ... (Windows / HD / ...)

Internet-Café Server/Client Application Open CD, Start Browser, Lock remote client, etc.

MultipleFuncsWithOneHotkey Start different funcs by hitting one hotkey different times

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
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...