Jump to content

Recommended Posts

Posted

I am trying to use AutoIT to find out what software has been installed onto machines - a software audit program basically.

Could someone please point me in the right direction? I have managed to do this with VBS but was wondering if there was anything within AutoIT that would do the job?

Thanks.

Pete.

Posted (edited)

Do a RegEnumKey loop in HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.

Some programs write uninstall info to HKCU instead of HKLM, so might wanna RegEnumKey that too, but to get such list for all users that are not logged-in would be a bit more problematic.

Edited by Siao

"be smart, drink your wine"

Posted

Thanks, have now got the following but (noob question I know) how do I continue the loop until all the available registry keys have been displayed rather than just 10?

For $i= 1 to 10
    $SoftwareKey = RegEnumKey("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", $i)
    If @error <> 0 then ExitLoop
    MsgBox(4096, "SubKey #" & $i, $SoftwareKey)
Next

Thanks.

Posted

Thanks, works like a charm :whistle:

I have been trying now to read the DisplayName value from each on of the keys returned so used the following:

$i = 1
Do
    $SoftwareKey = RegEnumKey("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall", $i)
    $DisplayName = RegRead($SoftwareKey, "DisplayName")
    If @error <> 0 then ExitLoop
    MsgBox(4096, "SubKey #" & $i, $SoftwareKey & " - " & $DisplayName)
$i = $i + 1
Until 0

Unfortunatly, this dosn't return anything. I commented-out the If @error line and did get a MsgBox back for each Key but no DisplayName value was returned.

Am I expecting this to be easier than it should be :lmao:

Thanks.

Posted

Two things...

One: You need to move your $displayname = .... line AFTER the If @error .... line.

Two: The REGENUMKEY only returns the key, not the whole hive string, so your $displayname line needs to be like this:

$DisplayName = RegRead("HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\" & $SoftwareKey, "DisplayName")

Hope this helps

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...